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

Copy Page Hierarchy API error message reporting title conflict

XMLWordPrintable

      Issue Summary

      The Copy Page Hierarchy copy API (https://developer.atlassian.com/cloud/confluence/rest/api-group-content---children-and-descendants/#api-wiki-rest-api-content-id-pagehierarchy-copy-post) takes parameters allowing the titles of copied pages to be specified. When this results in a conflict, the error returned by the API can be slightly misleading in the sense of where to look for the conflict.

      Steps to Reproduce

      1. Create a page titled ConflictBugParent (let's refer to the allocated content ID of this page as conflict-bug-parent).
      2. Within page ConflictBugParent, create a child page titled ConflictBug (let's refer to the allocated content ID of this page as conflict-bug).
      3. Outside the ConflictBugParent hierarchy, create a page titled Template-ConflictBug (let's refer to the allocated content ID of this page as template-conflict-bug).
      4. Invoke the as indicated in the following curl command and observe the error message returned:

       

      curl --request POST \
        --url 'https://some-tenant.atlassian.net/wiki/rest/api/content/template-conflict-bug/pagehierarchy/copy' \
        --user '' \
        --header 'Content-Type: application/json' \
        --data '{
          "copyAttachments": true,
          "copyPermissions": false,
          "copyProperties": true,
          "copyLabels": true,
          "copyCustomContents": true,
          "destinationPageId": "conflict-bug-parent",
          "titleOptions": {
            "prefix": "",
            "replace": "",
            "search": "Template-"
          }
        }'
      

       

      Expected Results

      The Copy Fails with the message:

      The copied pages have conflicting page titles. e.g.: ConflictBug. Please specify a page title prefix to avoid conflict.

      Actual Results

      The Copy Fails with the message:

      The copied pages have conflicting page titles. e.g.: Template-ConflictBug. Please specify a page title prefix to avoid conflict.

      This is misleading because the error is referencing the old title of the page before the titleOptions are applied.

      Workaround

      None

              Unassigned Unassigned
              dmorrow@atlassian.com Dugald Morrow
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: