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

Body is not changed when copying page with API

    XMLWordPrintable

    Details

      Description

      Issue Summary

      Copying a page via API is an awesome way to automate some of our daily tasks! It seems that sometimes when we need to copy a page but change its body, the endpoint does not respect our changes and just copy the content from the original page.

      Steps to Reproduce

      1. Create a page with some text content;
      2. Use the copy page API to copy the page you created (change some of the fields from the below curl and run it on a terminal):
        Unable to find source-code formatter for language: curl. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
        curl --request POST \
          --url 'https://<SITE_NAME>.atlassian.net/wiki/rest/api/content/<CONTENT_ID>/copy' \
          --user '<EMAIL:API_TOKEN>' \
          --header 'Accept: application/json;charset=UTF-8' \
          --header 'Content-Type: application/json' \
          --data '{
          "destination": {
            "type": "parent_page",
            "value": "<CONTENT_ID>"
          },
          "pageTitle": "Page copied via API",
          "body": {
            "storage": {
              "value": "This text should appear in the new copied page instead of the same content the original page has",
              "representation": "storage"
            }
          }
        }'

      Expected Results

      Even copying the page, the body of the page should be changed to what we set in the body parameter.

      Actual Results

      The page is just copied with no changes.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              etekin@atlassian.com Engin Tekin
              Reporter:
              vsiqueira Vinicius
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: