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.
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()
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
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.