Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-67046

Reordering pages through REST API doesn't work properly

XMLWordPrintable

      Summary

      Updating content especially changing the parent page of the respective page doesn't work with REST API unless the title of the page is modified. 

      Environment

      • Confluence Cloud 
      • REST API

      Steps to Reproduce

      1. Using the endpoint: https://srandhawa.atlassian.net/wiki/rest/api/content/668827653 and GET method, it will fetch the details of the page.
      2. Adding below body text:
        {"title":"Child Page #1",
        "type":"page",
        "space":{"key":"NS"},
        "version":{"number":"2"},
        "ancestors":[{"id":"668991510"}]
        }
      3. Refresh the page from UI to observe if there is page reorder operation is performed. You will observe new page version added and the output will return 200 with no updation.

      Expected Results

      It should move the page under the new parent page.

      Actual Results

      Nothing changes

      Notes

      Workaround

      1. Changing the title and incrementing the version works like a charm:
        {"title":"Child Page #1 with postman",
        "type":"page",
        "space":{"key":"NS"},
        "version":{"number": "3"},
        "ancestors":[{"id":"668991510"}]
        }
      1. The refresh reorders the page here:
        {
            "id": "668827653",
            "type": "page",
            "status": "current",
            "title": "Child Page #1 with postman",
            "space": {
                "id": 647921666,
                "key": "NS",
                "name": "New space",
                "type": "global",
                "status": "current",
                "_expandable": {
                    "settings": "/rest/api/space/NS/settings",
                    "metadata": "",
                    "operations": "",
                    "lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=NS",
                    "permissions": "",
                    "icon": "",
                    "description": "",
                    "theme": "/rest/api/space/NS/theme",
                    "history": "",
                    "homepage": "/rest/api/content/647922129"
                },
                "_links": {
                    "webui": "/spaces/NS",
                    "self": "https://srandhawa.atlassian.net/wiki/rest/api/space/NS"
                }
            },
            "history": {
                "latest": true,
                "createdBy": {
                    "type": "known",
                    "accountId": "5b7caf50332df52a5d9449d8",
                    "accountType": "atlassian",
                    "email": "srandhawa@atlassian.com",
                    "publicName": "Supreet",
                    "profilePicture": {
                        "path": "/wiki/aa-avatar/5b7caf50332df52a5d9449d8",
                        "width": 48,
                        "height": 48,
                        "isDefault": false
                    },
                    "displayName": "Supreet Randhawa",
                    "_expandable": {
                        "operations": "",
                        "details": "",
                        "personalSpace": ""
                    },
                    "_links": {
                        "self": "https://srandhawa.atlassian.net/wiki/rest/api/user?accountId=5b7caf50332df52a5d9449d8"
                    }
                },
                "createdDate": "2019-07-04T04:43:52.437Z",
                "_expandable": {
                    "lastUpdated": "",
                    "previousVersion": "",
                    "contributors": "",
                    "nextVersion": ""
                },
                "_links": {
                    "self": "https://srandhawa.atlassian.net/wiki/rest/api/content/668827653/history"
                }
            },
            "version": {
                "by": {
                    "type": "known",
                    "accountId": "5b970b196d713e3014941aed",
                    "accountType": "atlassian",
                    "email": "skahol@atlassian.com",
                    "publicName": "Swati Kahol",
                    "profilePicture": {
                        "path": "/wiki/aa-avatar/5b970b196d713e3014941aed",
                        "width": 48,
                        "height": 48,
                        "isDefault": false
                    },
                    "displayName": "Swati Kahol",
                    "_expandable": {
                        "operations": "",
                        "details": "",
                        "personalSpace": ""
                    },
                    "_links": {
                        "self": "https://srandhawa.atlassian.net/wiki/rest/api/user?accountId=5b970b196d713e3014941aed"
                    }
                },
                "when": "2019-07-04T06:11:55.364Z",
                "friendlyWhen": "just a moment ago",
                "number": 3,
                "minorEdit": false,
                "syncRev": "0.confluence$content$668827653.8",
                "syncRevSource": "synchrony",
                "confRev": "confluence$content$668827653.12",
                "_expandable": {
                    "collaborators": "",
                    "content": "/rest/api/content/668827653"
                },
                "_links": {
                    "self": "https://srandhawa.atlassian.net/wiki/rest/api/content/668827653/version/3"
                }
            },
            "ancestors": [
                {
                    "id": "647922129",
                    "type": "page",
                    "status": "current",
                    "title": "New space",
                    "macroRenderedOutput": {},
                    "extensions": {
                        "position": 238927332
                    },
                    "_expandable": {
                        "childTypes": "",
                        "container": "/rest/api/space/NS",
                        "metadata": "",
                        "operations": "",
                        "children": "/rest/api/content/647922129/child",
                        "restrictions": "/rest/api/content/647922129/restriction/byOperation",
                        "history": "/rest/api/content/647922129/history",
                        "ancestors": "",
                        "body": "",
                        "version": "",
                        "descendants": "/rest/api/content/647922129/descendant",
                        "space": "/rest/api/space/NS"
                    },
                    "_links": {
                        "self": "https://srandhawa.atlassian.net/wiki/rest/api/content/647922129",
                        "tinyui": "/x/0YGeJg",
                        "editui": "/pages/resumedraft.action?draftId=647922129",
                        "webui": "/spaces/NS/overview"
                    }
                },
                {
                    "id": "668991510",
                    "type": "page",
                    "status": "current",
                    "title": "New parent page #2",
                    "macroRenderedOutput": {},
                    "extensions": {
                        "position": 282425549
                    },
                    "_expandable": {
                        "childTypes": "",
                        "container": "/rest/api/space/NS",
                        "metadata": "",
                        "operations": "",
                        "children": "/rest/api/content/668991510/child",
                        "restrictions": "/rest/api/content/668991510/restriction/byOperation",
                        "history": "/rest/api/content/668991510/history",
                        "ancestors": "",
                        "body": "",
                        "version": "",
                        "descendants": "/rest/api/content/668991510/descendant",
                        "space": "/rest/api/space/NS"
                    },
                    "_links": {
                        "self": "https://srandhawa.atlassian.net/wiki/rest/api/content/668991510",
                        "tinyui": "/x/FgDgJw",
                        "editui": "/pages/resumedraft.action?draftId=668991510",
                        "webui": "/spaces/NS/pages/668991510/New+parent+page+%232"
                    }
                }
            ],
            "container": {
                "id": 647921666,
                "key": "NS",
                "name": "New space",
                "type": "global",
                "status": "current",
                "history": {
                    "createdBy": {
                        "type": "known",
                        "accountId": "5b7caf50332df52a5d9449d8",
                        "accountType": "atlassian",
                        "email": "srandhawa@atlassian.com",
                        "publicName": "Supreet",
                        "profilePicture": {
                            "path": "/wiki/aa-avatar/5b7caf50332df52a5d9449d8",
                            "width": 48,
                            "height": 48,
                            "isDefault": false
                        },
                        "displayName": "Supreet Randhawa",
                        "_expandable": {
                            "operations": "",
                            "details": "",
                            "personalSpace": ""
                        },
                        "_links": {
                            "self": "https://srandhawa.atlassian.net/wiki/rest/api/user?accountId=5b7caf50332df52a5d9449d8"
                        }
                    },
                    "createdDate": "2019-06-05T11:12:41.726Z"
                },
                "_expandable": {
                    "settings": "/rest/api/space/NS/settings",
                    "metadata": "",
                    "operations": "",
                    "lookAndFeel": "/rest/api/settings/lookandfeel?spaceKey=NS",
                    "permissions": "",
                    "icon": "",
                    "description": "",
                    "theme": "/rest/api/space/NS/theme",
                    "homepage": "/rest/api/content/647922129"
                },
                "_links": {
                    "webui": "/spaces/NS",
                    "self": "https://srandhawa.atlassian.net/wiki/rest/api/space/NS"
                }
            },
            "macroRenderedOutput": {},
            "body": {
                "storage": {
                    "value": "<p>Trying with manual creation</p>",
                    "representation": "storage",
                    "embeddedContent": [],
                    "_expandable": {
                        "content": "/rest/api/content/668827653"
                    }
                },
                "_expandable": {
                    "editor": "",
                    "atlas_doc_format": "",
                    "view": "",
                    "export_view": "",
                    "styled_view": "",
                    "editor2": "",
                    "anonymous_export_view": ""
                }
            },
            "extensions": {
                "position": "none"
            },
            "_expandable": {
                "childTypes": "",
                "metadata": "",
                "operations": "",
                "children": "/rest/api/content/668827653/child",
                "restrictions": "/rest/api/content/668827653/restriction/byOperation",
                "descendants": "/rest/api/content/668827653/descendant"
            },
            "_links": {
                "editui": "/pages/resumedraft.action?draftId=668827653",
                "webui": "/spaces/NS/pages/668827653/Child+Page+%231+with+postman",
                "context": "/wiki",
                "self": "https://srandhawa.atlassian.net/wiki/rest/api/content/668827653",
                "tinyui": "/x/BYDdJw",
                "collection": "/rest/api/content",
                "base": "https://srandhawa.atlassian.net/wiki"
            }
        }

              Unassigned Unassigned
              srandhawa@atlassian.com Supreet (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: