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

Table of Content macro cannot be created via REST API if using HTML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a bug
    • Low
    • None
    • 7.13.2
    • None

    Description

      Issue Summary

      The customer is using GET to fetch information from a source page,

      GET /rest/api/content/11111111?spaceKey=TEST&expand=body.view
       

      then POST to create a new target page(copy source page to target page).

      POST /rest/api/content/
      

      However, if there is a Table of Contents Macro in the page, it will not be generated in new page.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Create a page, insert a Table of Contents Macro.
      2. Using GET API (/rest/api/content/ {contentid}

        ) to fetch the page created.

      3. Copy the part of TOC into a file( toc.json ), and using this file to create new page.
      4. Run POST REST API to create page
        curl  -u admin:abc -X POST -H 'Content-Type: application/json'  -d '@toc.json'  "http://myconfluence:8090/rest/api/content"
        

      Expected Results

      Table of content macro will be generated in new page.

      Actual Results

      Table of content macro is not generated in new page.

      Workaround

      Using storage format instead of HTML

      <ac:structured-macro  ac:name=\"toc\" />
      

      Attachments

        1. toc.json
          0.5 kB

        Activity

          People

            Unassigned Unassigned
            rli@atlassian.com Rick Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: