Confluence footer-comment attachments uploaded through REST API do not render in the UI

XMLWordPrintable

    • Minor

      Issue Summary

      When an attachment is uploaded to a Confluence footer comment using the v1 The Confluence Cloud REST API REST API, the attachment is created successfully but does not render when embedded in the footer comment.

      The behavior is reproducible. Attachments uploaded to the same footer comment through the Confluence UI render correctly.

      The observed difference is that REST API uploads use a different extensions.collectionName value from UI-created attachments:

       

      Upload method extensions.collectionName
      REST API v1 contentId-<pageId>
      Confluence UI comment-container-<pageId>

       

      Steps to Reproduce

      1. Create a Confluence page and record its <pageId>
      2. Create a footer comment on the page and record the returned comment id:
        POST /wiki/api/v2/footer-comments
        Content-Type: application/json
        
        {
          "pageId": "<pageId>",
          "body": {
            "representation": "storage",
            "value": "<p>test comment</p>"
          }
        } 
      1. Upload an image to the footer comment using the v1 Create attachment endpoint:
      POST /wiki/rest/api/content/<commentId>/child/attachment
      X-Atlassian-Token: no-check
      Content-Type: multipart/form-data
      file=<image.png>
      minorEdits=true 

      4. Retrieve the attachment metadata with the container and extension fields expanded and observe that the "extensions.collectionName" is set as "contentId-<pageId>"

      GET /wiki/rest/api/content/<attachmentId>?expand=container,extensions
      
      {
        "extensions": {
          "collectionName": "contentId-<pageId>"
        }
      }

      5. Embed the attachment in the comment body and view in browser. 
      The embedded image does not render in the Confluence UI.

      PUT /wiki/api/v2/footer-comments/<commentId>
      Content-Type: application/json
      
      {
        "version": { "number": 2 },
        "body": {
          "representation": "storage",
          "value": "<p>test</p><ac:image><ri:attachment ri:filename=\"image.png\" /></ac:image>"
        }
      } 

       

      However, when the same attachment is added to the comment using the confluence UI, it gets created with extensions.collectionName as comment-container-<pageId> and it renders fine on the UI. 

      Expected Results

      • Attachments uploaded through the REST API to a footer comment should render when embedded in that comment.

      Actual Results

      • The embedded image through REST API to a footer comment does not render in the Confluence UI.

      Workaround

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

              Assignee:
              Unassigned
              Reporter:
              Karan Ahuja
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: