Multipart/form-data attachment pusg using Rest API from Snow->Jira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2018 05:53 AM
Hi All,
We are integrating ServiceNow with JIRA .We are facing issue with attachment push from SNOW->JIRA.
As we have to use Content-Type as "multipart-form-data", am not able to set request with attachment that need to be send.
Seems like setRequestBodyFromAttachment('sys_id') is not working, as its returning Http Status -200, but no response object.
Below script am using:
try
{
var req = new sn_ws.RESTMessageV2('Jira Integration Attachment', 'Post Attach');
req.setStringParameterNoEscape('key', event.parm1);
req.setRequestHeader("X-Atlassian-Token","no-check");
req.setRequestHeader("Content-type","multipart/form-data;boundary="+file[i].id); // file[i].id- sys id of attachment
req.setRequestHeader("Accept","application/json");
req.setMIDServer('mid-sever name);
req.setEccParameter('skip_sensor', true);
req.setStringParameter("file",file[i].name); // name of file
req.setRequestBodyFromAttachment(file[i].id); // sys id of attachment
var res= req.execute();
var resBody= res.getBody();
}
catch(ex)
{
gs.log("exception : "+ex);
}
Please help with this.
Thanks,
Ashish Avinav
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2019 06:11 AM
Hi,
Try it.
@ http://www.john-james-andersen.com/blog/service-now/rest-based-servicenow-jira-integration-poc.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 07:05 AM
Hi,
Multipart/form-data requests are now supported via the REST action step in the IntegrationHub which comes as part of the ServiceNow IntegrationHub Installer plugin available for a fee in the Madrid release.
The procedure to set this up is explained in the below knowledge article.
How to send Outbound REST request with multipart/form-data
Regards,
Prabhat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 05:18 PM
You can send binary attachments from ServiceNow to Jira and other platforms with multipart without MID server, however it is pretty complicated. This article explains it:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 03:42 AM
Can you help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 04:21 AM
Hi Ashish
please ensure that the attachment sys_id is correct and corresponds to a valid attachment in SNOW and Verify that the 'Jira Integration Attachment' REST message in ServiceNow is properly configured, specifically the 'Post Attach' HTTP method. and the Content-Type header in your request should be set to "multipart/form-data".
While you work on resolving this issue, it's worth considering alternative solutions such as Exalate. I have been using it quite a bit and it works flawlessly cause of the decentralized architecture.