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

Ability to flag page updates as a "minor revision" in the Remote API

    • 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.

      It would be nice if the Remote API supported version comment and minor revision when creating or editing pages remotely.

            [CONFSERVER-5725] Ability to flag page updates as a "minor revision" in the Remote API

            Looks like the docs weren't updated, so I just did that.

            Don Brown (Inactive) added a comment - Looks like the docs weren't updated, so I just did that.

            Anatoli added a comment - - edited

            Jeff, bellow is the code we use in our tests:

                public long updatePage(Page page, boolean minorEdit, String versionComment)
                {
                    Hashtable<String, Object> options = new Hashtable<String, Object>();
                    options.put("minorEdit", minorEdit);
                    if (versionComment != null)
                        options.put("versionComment", versionComment);
            
                    Map<String, String> remotePage = (Map<String, String>) execute("updatePage", object(
                            "id", String.valueOf(page.getId()),
                            "space", page.getSpace().getKey(),
                            "title", page.getTitle(),
                            "parentId", Long.toString(page.getParentPageId()),
                            "content", page.getContent(),
                            "version", String.valueOf(page.getVersion())
                    ), options);
            
                    page.setId(Long.valueOf(remotePage.get("id")));
                    page.setVersion(Integer.valueOf(remotePage.get("version")));
            
                    return Long.valueOf((String) remotePage.get("id"));
                }
            

            storePage and updatePage act the same if you deal with existing page.

            Anatoli added a comment - - edited Jeff, bellow is the code we use in our tests: public long updatePage(Page page, boolean minorEdit, String versionComment) { Hashtable< String , Object > options = new Hashtable< String , Object >(); options.put( "minorEdit" , minorEdit); if (versionComment != null ) options.put( "versionComment" , versionComment); Map< String , String > remotePage = (Map< String , String >) execute( "updatePage" , object( "id" , String .valueOf(page.getId()), "space" , page.getSpace().getKey(), "title" , page.getTitle(), "parentId" , Long .toString(page.getParentPageId()), "content" , page.getContent(), "version" , String .valueOf(page.getVersion()) ), options); page.setId( Long .valueOf(remotePage.get( "id" ))); page.setVersion( Integer .valueOf(remotePage.get( "version" ))); return Long .valueOf(( String ) remotePage.get( "id" )); } storePage and updatePage act the same if you deal with existing page.

            If anyone has gotten minorEdit to work, sample code would be much appreciated. Using Apache XMLRPC and passing a vector of two Hashmaps (the page and the options) like this causes the page to update, but still results in notification emails:

            XmlRpcClient client = ...;
            String loginToken = getLoginToken(confSettings);
            
            Vector paramsVector = new Vector();
            paramsVector.add(loginToken);
            page.setSpace(spaceKey);
            
            paramsVector.add(page.getPageParams());
            Hashtable editOptions = new Hashtable<String, String>();
            
            editOptions.put("versionComment", "Version comment");
            editOptions.put("minorEdit", Boolean.TRUE.toString());
            paramsVector.add(editOptions);
            
            PageForXmlRpc resultPage = new PageForXmlRpc();
            resultPage.setPageParams(client.execute("confluence1.storePage", paramsVector));
            

            Jeff Turner added a comment - If anyone has gotten minorEdit to work, sample code would be much appreciated. Using Apache XMLRPC and passing a vector of two Hashmaps (the page and the options) like this causes the page to update, but still results in notification emails: XmlRpcClient client = ...; String loginToken = getLoginToken(confSettings); Vector paramsVector = new Vector(); paramsVector.add(loginToken); page.setSpace(spaceKey); paramsVector.add(page.getPageParams()); Hashtable editOptions = new Hashtable< String , String >(); editOptions.put( "versionComment" , "Version comment" ); editOptions.put( "minorEdit" , Boolean .TRUE.toString()); paramsVector.add(editOptions); PageForXmlRpc resultPage = new PageForXmlRpc(); resultPage.setPageParams(client.execute( "confluence1.storePage" , paramsVector));

            CharlesA added a comment -

            Because of all the hassle of the Windows build, I didn't get the chance to follow through with this before I went on holiday. I'm handing it over to Anatoli - needs a tech review and any changes that result from it.

            CharlesA added a comment - Because of all the hassle of the Windows build, I didn't get the chance to follow through with this before I went on holiday. I'm handing it over to Anatoli - needs a tech review and any changes that result from it.

            CharlesA added a comment - - edited

            New method added to the remote API for 2.10:

            updatePage(token, page, options)

            "page" is the normal Page struct, but must represent an existing page
            "options" is a PageUpdateOptions struct with the following:

            key Type Value
            versionComment String Edit comment for the updated page
            minorEdit Boolean is this update a 'minor edit'? (default value: false)

            CharlesA added a comment - - edited New method added to the remote API for 2.10: updatePage(token, page, options) "page" is the normal Page struct, but must represent an existing page "options" is a PageUpdateOptions struct with the following: key Type Value versionComment String Edit comment for the updated page minorEdit Boolean is this update a 'minor edit'? (default value: false)

            I think this would be a major improvement. I also have a script which updates hundreds of pages..and consequently spams all of those with a watch on the space.

            Better still would be to change the default to no notification, but there is a separate issue raised for that.

            Kevin Ruscoe added a comment - I think this would be a major improvement. I also have a script which updates hundreds of pages..and consequently spams all of those with a watch on the space. Better still would be to change the default to no notification, but there is a separate issue raised for that.

            I'd be very interested in this feature too. I'm creating a build automation system that uses Confluence for storing status and for sending notifications. For each build, I'd like to update a status page specific to that build to indicate the status of the build. I only want users notified via email once the build completes, so each interim page update should be flagged as minor so that users do not get spammed with email.

            Jeff Schnitter added a comment - I'd be very interested in this feature too. I'm creating a build automation system that uses Confluence for storing status and for sending notifications. For each build, I'd like to update a status page specific to that build to indicate the status of the build. I only want users notified via email once the build completes, so each interim page update should be flagged as minor so that users do not get spammed with email.

            AlexH added a comment -

            At a site with 1000+ users we've developed several custom scripts to update a few key pages with critical information at regular intervals. The problem is our "Recently Updated" section of Confluence is getting spammed with the changes made by this automated user. It would be extremely useful if the remote API would accept a boolean flag similiar to the gui "Minor Update" that would disable posting a notification about the change to the page affected by the Remote API.

            In the meantime if anyone has any workarounds to filter out changes in the "Recently Updated" section, it would be extremely helpful to us.

            We've thought about partitioning these automated pages into a seperate space, but short of turning off "view" permissions on that space I don't know how to suppress the recently updated section on the main dashboard for changes in a given space.

            AlexH added a comment - At a site with 1000+ users we've developed several custom scripts to update a few key pages with critical information at regular intervals. The problem is our "Recently Updated" section of Confluence is getting spammed with the changes made by this automated user. It would be extremely useful if the remote API would accept a boolean flag similiar to the gui "Minor Update" that would disable posting a notification about the change to the page affected by the Remote API. In the meantime if anyone has any workarounds to filter out changes in the "Recently Updated" section, it would be extremely helpful to us. We've thought about partitioning these automated pages into a seperate space, but short of turning off "view" permissions on that space I don't know how to suppress the recently updated section on the main dashboard for changes in a given space.

            Hi Lewis,

            There is already a ticket to have version comments in the Remote API: CONF-4288

            I've amended the issue title to reflect your other request.

            Jeremy

            Jeremy Higgs added a comment - Hi Lewis, There is already a ticket to have version comments in the Remote API: CONF-4288 I've amended the issue title to reflect your other request. Jeremy

              akazatchkov Anatoli
              f865bf0b0fce Lewis Stewart
              Votes:
              11 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: