We are trying to programmatically add attachments to Issues via REST API.
Found an example here -
https://confluence.atlassian.com/jirakb/how-to-add-an-attachment-to-a-jira-issue-using-rest-api-699957734.html
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-checkAnd 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
It looks like you're new here. Sign in or register to get started.