Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-38804

Add ability to disable 'Notify Watcher' when creating content through REST API

    • 2
    • 5
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      Problem Definition

      The SOAP API (XML/RPC) had a minor revision element that could be set to true in order to disable notify watcher. There is no equivalent in the REST API, so any mass updates performed using the REST API will spam Confluence users.

      Suggested Solution

      3 possibly solutions:

      • Add an argument that can be used in the REST request to disable Notify Watchers
      • Set the default behavior when using REST to disable Notify Watchers
      • Add a setting in the Confluence administration panel to either enable or disable Notify Watchers when using Remote APIs

      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"
      }
      

            [CONFSERVER-38804] Add ability to disable 'Notify Watcher' when creating content through REST API

            Does the solution for suppressing notifications for content updates include attachments?  We are constantly adding/editing attachments to certain pages within a space and would like them to not receive the emails but still be able to watch the space.  

            corybenedict added a comment - Does the solution for suppressing notifications for content updates include attachments?  We are constantly adding/editing attachments to certain pages within a space and would like them to not receive the emails but still be able to watch the space.  

            +1 the API should have the same capabilities as the user interface

            At the very least update the REST API documentation to indicate how this is done. 

             

            It's frustrating having to search forums for documentation that should live in the API reference eg https://developer.atlassian.com/server/confluence/confluence-server-rest-api/

            Martin Foster added a comment - +1 the API should have the same capabilities as the user interface At the very least update the REST API documentation to indicate how this is done.    It's frustrating having to search forums for documentation that should live in the API reference eg  https://developer.atlassian.com/server/confluence/confluence-server-rest-api/

            Propeties minorEdit doesn't work for  Create content  POST /rest/api/content Work only Update

            {{}}{

            {{ "type": "page",}}
            {{ "title": "test_page*",}}
            {{ "space": {}}
            {{ "key": "wtis"}}
            {{ },}}
            {{ "version": {}}
            {{ "number": 1,}}
            {{ "minorEdit": true}}
            {{ },}}
            {{ "ancestors": [{}}
            {{ "id": "956913"}}
            {{ }],}}
            {{ "body": {}}
            {{ "storage": {}}
            {{ "value": "<p>Test. </p>",}}
            {{ "representation": "storage"}}
            {{ }}}
            {{ }}}
            }

            Evgenijj Bardin added a comment - Propeties minorEdit doesn't work for   Create content   POST /rest/api/content Work only Update {{}}{ {{ "type": "page",}} {{ "title": "test_page*",}} {{ "space": {}} {{ "key": "wtis"}} {{ },}} {{ "version": {}} {{ "number": 1,}} {{ "minorEdit": true}} {{ },}} {{ "ancestors": [{}} {{ "id": "956913"}} {{ }],}} {{ "body": {}} {{ "storage": {}} {{ "value": "<p>Test. </p>",}} {{ "representation": "storage"}} {{ }}} {{ }}} }

            shaurya.chawla to prevent notifications being sent to watchers upon content update using the REST api , you need to specify the version field with the following properties

            "version": {
               "number": incremented_version,
               "minorEdit": true
            }

            See the example curl command as stated in the earlier comments

             curl -v -X PUT -u admin:admin "http://localhost:8080/confluence/rest/api/content/${content_id}" \
                    -H 'Content-Type: application/json' \
                    -d "{\
            \"type\"    : \"page\", \
            \"title\"   : \"DEV - all dev pages need this prefix\", \
            \"version\" : { \
                \"number\" : 3, \
                \"message\": \"just adding a prefix\", \
                \"minorEdit\": true \
                } \
            }"

             

            Hasnae (Inactive) added a comment - shaurya.chawla to prevent notifications being sent to watchers upon content update using the REST api , you need to specify the version field with the following properties "version" : { "number" : incremented_version, "minorEdit" : true } See the example curl command as stated in the earlier comments curl -v -X PUT -u admin:admin "http: //localhost:8080/confluence/ rest /api/content/${content_id}" \ -H 'Content-Type: application/json' \ -d "{\ \ "type\" : \ "page\" , \ \ "title\" : \ "DEV - all dev pages need this prefix\" , \ \ "version\" : { \ \ "number\" : 3, \ \ "message\" : \ "just adding a prefix\" , \ \ "minorEdit\" : true \ } \ }"  

            hrehioui  I'm sorry I couldn't understand exactly what json field to add in version that would suppress/disable Notify watchers in confluence.

            I have a script that calls update an existing conf page using PUT rest api and i used version like this:
            "version": {"number": incremented_version}

            But people who are subscribed to the whole space or just the updating page still receive email notification; every time there is an update.

            Shaurya Chawla added a comment - hrehioui   I'm sorry I couldn't understand exactly what json field to add in version that would suppress/disable Notify watchers in confluence. I have a script that calls update an existing conf page using PUT rest api and i used version like this: "version": {"number": incremented_version} But people who are subscribed to the whole space or just the updating page still receive email notification; every time there is an update.

            Matt Doar added a comment -

            This really needs to be documented!

            Matt Doar added a comment - This really needs to be documented!

            Matt Doar added a comment -

            I see minorEdit and hidden parameters in the reference examples but nothing in the documentation about them. Useful to know about this, thanks

            Matt Doar added a comment - I see minorEdit and hidden parameters in the reference examples but nothing in the documentation about them. Useful to know about this, thanks

            Hasnae (Inactive) added a comment - - edited

            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.

            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"
            }

            Here is a sample curl command to verify it works

            curl -v -X PUT -u admin:admin "http://localhost:8080/confluence/rest/api/content/${content_id}" \
                    -H 'Content-Type: application/json' \
                    -d "{\
            \"type\"    : \"page\", \
            \"title\"   : \"DEV - all dev pages need this prefix\", \
            \"version\" : { \
                \"number\" : 3, \
                \"message\": \"just adding a prefix\", \
                \"minorEdit\": true \
                } \
            }"

            It appears that in your use case, you are creating content (not updating it) that indeed does not seem to be supported

            Hasnae (Inactive) added a comment - - edited 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. 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" } Here is a sample curl command to verify it works curl -v -X PUT -u admin:admin "http: //localhost:8080/confluence/ rest /api/content/${content_id}" \ -H 'Content-Type: application/json' \ -d "{\ \ "type\" : \ "page\" , \ \ "title\" : \ "DEV - all dev pages need this prefix\" , \ \ "version\" : { \ \ "number\" : 3, \ \ "message\" : \ "just adding a prefix\" , \ \ "minorEdit\" : true \ } \ }" It appears that in your use case, you are creating content (not updating it) that indeed does not seem to be supported

            This would be very helpful for us, too.

            Can you implement the same solution as in JIRA, please ?

            https://jira.atlassian.com/browse/JRA-34423

             

            Martin Papproth added a comment - This would be very helpful for us, too. Can you implement the same solution as in JIRA, please ? https://jira.atlassian.com/browse/JRA-34423  

            We have a reporting tool that uploads customer analytics once a month. My work-around for the problem described in this ticket is to have the reporting tool upload to my personal space, and I then have to manually move it to the shared space. Otherwise everyone in our company gets hundreds of emails from me once a month and the less technical members of our company seemed to think this is something I do out of spite for them.
            Please fix the API. :<

            John Jones added a comment - We have a reporting tool that uploads customer analytics once a month. My work-around for the problem described in this ticket is to have the reporting tool upload to my personal space, and I then have to manually move it to the shared space. Otherwise everyone in our company gets hundreds of emails from me once a month and the less technical members of our company seemed to think this is something I do out of spite for them. Please fix the API. :<

            Any chance this work will be done? We maintain inventory pages that are frequently updated via the REST API and likewise this is generating a lot of noise for us.

            Edward C. Skoviak added a comment - Any chance this work will be done? We maintain inventory pages that are frequently updated via the REST API and likewise this is generating a lot of noise for us.

            We're in the process of migrating a lot of documentation to confluence. It's generated and then deployed using the REST API, and there are many pages involved. Every time we update and deploy this documentation, any watchers for that space get 1 email per updated page, which is extremely annoying. It would be nice if we could batch deploy these updates and then just send one notification out to watchers.

            Is there a workaround possible?

            Andy Earnshaw added a comment - We're in the process of migrating a lot of documentation to confluence. It's generated and then deployed using the REST API, and there are many pages involved. Every time we update and deploy this documentation, any watchers for that space get 1 email per updated page, which is extremely annoying. It would be nice if we could batch deploy these updates and then just send one notification out to watchers. Is there a workaround possible?

              Unassigned Unassigned
              sbrannen@atlassian.com Branno (Inactive)
              Votes:
              75 Vote for this issue
              Watchers:
              51 Start watching this issue

                Created:
                Updated: