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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not a bug
    • Priority: Low
    • None
    • Affects Version/s: 7.13.2
    • None
    • 1
    • Severity 3 - Minor

      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\" />
      

        1. toc.json
          0.5 kB
          Rick Li

            Assignee:
            Unassigned
            Reporter:
            Rick Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: