Issue with attachment transfer from ServiceNow to JIRA

Venugopala Naidu
Contributor
February 8, 2019

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

2 answers

0 votes
K AKSHAY SAGAR
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2025

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.

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2019

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

Suggest an answer

Log in or Sign up to answer