-
Bug
-
Resolution: Unresolved
-
Low
-
1
-
Severity 3 - Minor
-
4
-
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
- Create a comment with an attachment with User A.
- Retrieve the ADF contents of the comment using /rest/api/3/issue/<issue-id>/.
- With User B, use POST /rest/api/3/issue to create an issue with the retrieved ADF content.
- The request will fail with the following error message:
{ "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>.