Hello, I am having an issue creating attachments for an existing issue using the REST API.
1. When I do a GET request to view my target issue, I am able to view the issue.
Request
curl --request GET --user <email:api-key> --header 'Accept:application/json' <organization domain>/rest/api/3/issue/{id}?fields=summaryResponse
{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"{id}","self":"<organization domain>/rest/api/3/issue/{id}","key":"{key}","fields":{"summary":"Target for attachments"}}2. When I do a GET request to view my permission to create attachments, I see that I have permission to create attachments.
Request
curl --request GET --url <organization domain>/rest/api/3/mypermissions?permissions=CREATE_ATTACHMENTS --user <email:api-key> --header 'Accept:application/json'
Response
{"permissions":{"CREATE_ATTACHMENTS":{"id":"19","key":"CREATE_ATTACHMENTS","name":"Create Attachments","type":"PROJECT","description":"Users with this permission may create attachments.","havePermission":true}}}Based on these two requests, I expected that I would be able to create an attachment for the relevant issue.
However: When I create a POST request to create an attachment, the response tells me that I can't access the issue.
Request
curl --location --request POST <organization domain>/rest/api/3/issue/{issue}/attachments --user <email:api-key> --header X-Atlassian-Token:nocheck --form file=@<path>\Test.txt Response
{"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}
Does anyone know what's happening here? I don't understand how to approach this issue. Thank you in advance for your help.