How to suppress event on Attachment upload?

For a page we can do something like -

pageManager.saveContentEntity(page,DefaultSaveContext.builder()
.suppressEvents(true)
.build());

Is there something similar which can be done for attachment upload too?

attachmentManager.saveAttachment(Attachment, Attachment, InputStream);

There doesn’t seem a method which can take in DefaultSaveContext. Or is there? Or is there some other way to achieve this?

Hi @sameer.v,

Can you confirm which product and deployment option you are referring to?

I assume Confluence Server? But want to make sure.

Thanks,
Ralph

Hi @rwhitbeck,
Thanks for the response.
Yes, Confluence Server 6.3.X

Hi @rwhitbeck,
Just checking in to see if you could provide any further inputs here :slight_smile:

The best you can do is set the ‘hidden’ field to true in the attachment. This will prevent a notification from being sent. But there will still be an event (com.atlassian.confluence.event.events.content.attachment.HiddenAttachmentCreateEvent) that is published.

1 Like