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-30-2024 07:50 AM
Is your issue resolved ? may i know how did u able to resolve ur issue ? we are working on the integration now and we have same requirement to send attachments to jira from SN through POST attachment api.
Please give me an high level idea how your issue got resolved. Thank you in advance.