The CreatorCon Call for Content is officially open! Get started here.

Send attachment from Servicenow to JIRA using REST API

kumaran
Giga Expert

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.

31 REPLIES 31

Inactive_Us1289
Mega Contributor

Hi Kumaran,



We are also working on SN-Jira integration using Rest API.


I just wanted to ask you, have you created a service account in SN User table to be able connect through the Rest API?


If yes, could you please let me know the configuration details for the Service Account.



Thanks in advance!


Aleksas Kucins1
Giga Expert

You can send binary attachments from ServiceNow to Jira and other platforms with multipart, however it is pretty complicated. This article explains it:

https://servicenowthink.wordpress.com/2020/04/13/how-to-send-binary-data-with-multipart-from-service...