I am unable to send attachments from ServiceNow to Jira. Can anyone help me out with this?

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 14, 2025

I have created a rest message in ServiceNow to send an attachment to the already existing issue in my Jira project. I have followed Jira attachment document for that. I am getting an empty response.

When I try to log the status code, it is showing 415 error. Please help me in this situation as soon as possible.

 

Thank you.

2 answers

0 votes
Gerusa Lobo _e-Core_
Atlassian Partner
February 14, 2025

Hello @K AKSHAY SAGAR 

To send attachment to jira, you need create a API call like this:

 

def postAttachment = post("https://{url}.atlassian.net/rest/api/2/issue/${issueKey}/attachments"

  .basicAuth("email","token")

  .header("Accept","application/json")

  .header("X-Atlassian-Token","no-check")

  .field("file", content, filename)

  .asJson()
The content is a binary.
For more information:
0 votes
Humashankar VJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2025

Hi @K AKSHAY SAGAR 

Please refer to the Community post which covers the same issue of getting a 415 error when transferring attachments from ServiceNow to Jira via REST API.

The solution highlighted is ensuring the correct Content-Type header is set (preferably multipart/form-data) and using the proper Jira API endpoint with the X-Atlassian-Token: no-check header.

Give a try and keep us posted

Issue with attachment transfer from ServiceNow to ...

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events