Prevent notifications when using REST API

Rosario De Domenico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2018

I am using the Confluence REST API for our Server installation in VBA macros to update (change or add) attachments to Confluence pages and to edit the page content.

Everything works fine but currently I have many subsequent API calls to a given page each of which triggers a notification e-mail to all people watching the page.

Is there an option in the API that I can use to use the "save" instead of the "save and notify" option?

Alternatively, is there a way to combine multiple calls to a given page so that they are all done together?

4 answers

1 accepted

1 vote
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2018

Hello Rosario,

Using the Confluence API allows for easier integration and awesome amounts of automation. When you’re editing multiple (hundreds of pages) at a time, and all those watches get notifications it can be painful to deal with. I have experienced the exact issue you are trying to avoid when bulk updating/automating.

There is a feature request to give you additional functionality to disable notifications of watchers. That Feature request can be found at CONFSERVER-38804 for server and for cloud CONFCLOUD-38804. If you are interested in seeing these feature become part of the product then we would suggest you vote and watch them to receive updates as they progress.

There is a way to disable notifications upon updating content. The work around is from the server feature request and it states the following:

Workaround

Comment from development:

Suppressing notifications upon updating a content via REST is already supported. You currently have to supply a version with an incremented number in the request payload. Add the "minorEdit" field to the

The version payload also supports minor edits and comments as follow

"version" : {
 "number"    : incrementedFromPrevious,
 "minorEdit" : true,
 "message"   : "some version comment to keep on the content history"
}

As stated above, without the work around, watchers of a space/page will be notified on creation/update of content.

I hope this clarifies the capabilities of the Confluence REST API along with a possible work around to your problem.

Regards,
Stephen Sifers

Rosario De Domenico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2018

Is there a similar workaround also for adding or updating attachments?

Forget the question this is already possible in the API call itself...

Like # people like this
Pavel December 6, 2018

+1 

I started using "minorEdit" : true, no more page change messages. But a lot of messages about adding attachments. This is not good!

norbert December 3, 2019

@Rosario De Domenico How do you disable notification when uploading or deleting attachments? The minorEdit thing does not seem to apply there.

Thanks!

Rosario De Domenico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 3, 2019

In the REST API call itself, you can use the option "-F minorEdit=true" which does the job.

It works for me.

Refer to: https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content/{id}/child/attachment-createAttachments

norbert December 3, 2019

I'll check, I'm using the python requests package though, not curl, so not sure how to pass that in there. 

Thanks!

KOSHTI NIKHILESH September 17, 2020

with the minorEdit =True option like below:-
"version": {
"number":41,
"minorEdit" : "true",
},

 

Watchers are still getting email about content changes. THough emails were sent after some delay :). It would be helpful if someone guide in this issue.

Robert Gottesman March 2, 2021

This strange, on updates in Cloud, I seemed to have turned off notifications with "minorEdit" set to False.

0 votes
Chris P. April 28, 2021

(Also posted on:

https://community.atlassian.com/t5/Confluence-questions/Rest-API-how-to-disable-page-creation-update-notifications/qaq-p/1316180

)

Thanks guys > did the same thing (remove watchers).

This was an issue for us when we were only updating attachments via API (vs content with a body).

Tried with both:

"minorEdit" : True

and

"minorEdit" : False 

included in API call data field, and it would still notify watchers via email.

 

Solution was to remove all watchers, update attachments, and the re-add the watchers back to affected pages.

 

Resources:

Get watches for page 

Remove watches for page 

Add content watcher 

0 votes
KOSHTI NIKHILESH September 17, 2020

With the minorEdit =True option like below:-
"version": {
"number":41,
"minorEdit" : "true",
},

 

Watchers are still getting email about content changes. THough emails were sent after some delay :). It would be helpful if someone guide in this issue.

0 votes
Jake Stone August 26, 2020

How do we prevent notifications when creating a new page?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events