Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-93305

Reusing an attachment in ADF content on Jira’s REST API results in a file format error

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: (no)

      This issue occurs when trying to reuse (POST) an attachment in an ADF payload with a different user. The request fails with a "We don't recognize the format of a file you added or the data in it" error, even though the file is accessible by both users in the UI.

      Steps to Reproduce

      1. Create a comment with an attachment with User A.
      2. Retrieve the ADF contents of the comment using /rest/api/3/issue/<issue-id>/.
      3. With User B, use POST /rest/api/3/issue to create an issue with the retrieved ADF content.
      4. The request will fail with the following error message:
      5. {
            "errorMessages": [],
            "errors": {
                "description": "We don't recognise the format of a file you added or the data in it. Remove and try again."
            }
        }

        This issue does not occur when using the UI.

      Expected Results

      The issue is created successfully with the attachment visible for both users.

      Actual Results

      The request fails with the error message:
      "We don't recognize the format of a file you added or the data in it. Remove and try again."
      Additionally, this error is logged in Splunk:

      {
          "error": {
              "code": "NotFoundError",
              "title": "The file with the given id does not exist in collection \"upload-user-collection-xxxx\"",
              "href": "https://media.prod.atl-paas.net#NotFoundError"
          },
          "httpStatusCode": 404
      }

       

      Workaround

      A workaround has been identified in this community thread. It involves replacing the attachment ID with the external URL, which can be found under the attachment object when running /rest/api/3/issue/<Issue-Key>.

              Unassigned Unassigned
              6a03409da198 Tatiane Padovani
              Votes:
              15 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated: