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

The Heading IDs returned via REST API are different than the ones rendered in the UI

    XMLWordPrintable

Details

    Description

      Issue Summary

      The heading IDs returned by the Get content REST API endpoint are different than the ones rendered in Confluence UI.

      This is not an issue on pages using the legacy editor (it only seems to happen in the new editor).

      Steps to Reproduce

      1. Create a page with a heading (e.g. page title "new page", with a heading 2 text saying "Heading Two")
      2. Click on the icon to copy the link to heading and paste it somewhere
      3. Open the developer console and find the Heading ID
      4. Call the Get content REST API endpoint and find the Heading ID in there too:
        https://<instancename>.atlassian.net/wiki/rest/api/content/<page-id>?expand=body.view
      5. Compare the Heading IDs collected in steps 2, 3 and 4

       

      Expected Results

      The IDs are the same

      Actual Results

      The IDs are different ("Heading-Two" in UI and link copied, "HeadingTwo" in the REST API response body):

      Heading link copied:

      https://NAME.atlassian.net/wiki/spaces/{KEY}/pages/{ID}/New+Page#Heading-Two 
      

      UI (Dev Console):

      <h2 id="Heading-Two" ... >

      Rest API:

      <h2 id=\"NewPage-HeadingTwo\">

       

      Workaround

      No workaround available at the moment.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dbonotto Dario B
              Votes:
              12 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated: