We are trying to programmatically add attachments to Issues via REST API.
Found an example here -
We execute:
curl -D- -u xxxx:xxxx -X POST -H "X-Atlassian-Token: nocheck" -F "file=@/text.txt" https://xxxx/rest/api/2/issue/ITA-999/attachments
We are getting the below response, and not seeing the attachment added when looking through the web UI.
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Location: https://xxxxx.xx.xx.io/jirarest/api/2/issue/ITA-999/attachments
What am I missing?
Hi, @joseph daniels
Welcome to Atlassian Community.
You're using wrong request. You wrote nocheck, but must be no-check
And file you entered like @/text.txt, in example is another format
Example from KB article:
curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: no-check" -F "file=@myfile.txt" http://myhost/rest/api/2/issue/TEST-123/attachments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.