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

Updating a page via REST API corrupts the shared draft if the page had an unpublished draft

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.4.6, 7.12.0
    • Editor - Drafts
    • None

      Issue Summary

      When a page with an unpublished draft is updated via REST API, the subsequent attempt to edit the page will result in the shared draft to produce text that is a combination of the unpublished draft + the latest version of the page.

      Steps to Reproduce

      1. Create a page with the text "confluence".
      2. Edit the page and replace the text to "jira".
      3. Close the editor and let it remain as an unpublished draft.
      4. Run an API call (PUT rest/api/content/12345) to update this page to the text "bitbucket".
        {
            "id": "12345",
            "status": "current",
            "version": {
                "number": 2
            },
            "space": {
                "key": "TEST"
            },
            "type": "page",
            "title": "Test page",
            "body": {
                "storage": {
                    "value": "<p>bitbucket</p>",
                    "representation": "storage"
                }
            }
        } 
      5. Refresh the page in the UI and you will see that the text switched from "confluence" to "bitbucket" in View mode.
      6. Click on 'Edit' to edit the page.

      Expected Results

      The page editor should have been updated to reflect the same content as in View mode.

      bitbucket

      Actual Results

      The page editor shows this as the shared draft:

      bitbkjirat

      Workaround

      Ensure that before you update the page via API, all unpublished drafts are published first. This will then result in the page and draft to be correctly updated.

            [CONFSERVER-68215] Updating a page via REST API corrupts the shared draft if the page had an unpublished draft

            There are no comments yet on this issue.

              mmadrid@atlassian.com Mark M
              azolkefli Athirah Zolkefli
              Affected customers:
              3 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated: