Hi Everyone,
We have a business requirement to transfer attachments from ServiceNow to JIRA via REST Integration. The built is done on ServiceNow with POST method.
However, we aren't able to transfer the attachment and received 415 HTTP status error.
The same concern as raised with ServiceNow and they asked for sample JSON Header and Body so that they can replicate the same to establish the connection.
Our URL: https://XXX/rest/api/2/issue/SER-2/attachments
Do someone have any sample REST Header and Body which takes attachments.
Thanks in advance :)
Regards
Hi Venugopala Naidu,
Did you figure it out that how can we send attachments from ServiceNow to Jira using REST API?
If yes, then let me know what the process is to do so.
Thanks in advance.
A 415 error for that REST call is an unsupported Media Type. It tends to happen because your REST call has defined a Content type that is either incorrect or simply not needed for that specific call. This is also explained in the Fisheye KB: REST API: "Error 415 Unsupported Media Type"
I realize that is for a different product than Jira, but the basic idea is the same here.
However we do have REST API documentation for our Jira products and their various endpoint examples:
If you're using Jira Server, check out the api/2/issue/{issueIdOrKey}/attachments endpoint
It has an example if using curl:
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
If using Jira Cloud, check out
POST /rest/api/3/issue/{issueIdOrKey}/attachments
It too has a number of examples using different frameworks for REST calls, such as curl, Java, python, php, etc.
I hope this helps.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.