Send attachment from Servicenow to JIRA using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 02:59 AM
I am working in ServiceNow to JIRA integration using REST API, I have implemented all the fields to create JIRA issue.
I am currently trying to send attachment from ServiceNow to JIRA ticket using mid server.
I used the below code as example in the post Jira REST Integration - How to send attachment? :
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('post');
request.setRequestHeader("X-Atlassian-Token","no-check");
request.setRequestHeader("Content-type","multipart/form-data");
request.setEndpoint('https://{jiraURL}/rest/api/2/issue/SN-2/attachments');
request.setBasicAuth("username","password");
request.setRequestBodyFromAttachment('abd7460b0fe39e001dc906ace1050e9f'); //sys_id of attachment record
var response = request.execute();
I am getting error in ECC Queue as 'attachment does not exists'
If anyone implemented this , please let me know .
Thanks in Advance.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:38 PM
Hi Jessica,
Thanks a lot for your reply.
I am thinking to use the attachment API provided by servicenow.
We are in Helsinki and we should have OOB API instead of huge script.
your script helps if the OOB API does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2017 01:56 AM
Yes, that's exactly my point. There should not be a need to write such a heavy script.
Has someone else tried successfully sending an attachment to Jira using REST attachment APIs and/or using request.setRequestBodyFromAttachment method?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2017 07:54 AM
I tried but ran into issues with the multipart/form-data. Good luck

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 12:37 AM
I recommend creating an Enhancement Request in HI. If enough customers feel that support of multipart form data APIs is needed, this will be taken into consideration for the road map.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 01:26 AM
Hi Jessica,
Could you please send me the code you were talking about?
Thanks.