REST API attachments Transfer to JIRA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2018 10:21 AM
Hi,
We have already implemented Snow-JIRA integration and built it by our own not using the John anderson POC for snow-jira integration update set.
Requirement is we want to implement the attachment transfer from Snow to JIRA application using REST API.
I have referred lot of community articles but unable to implement it because JIRA application supports only Multipart/form-data, it will not support Binary data format for attachments.
Anyone if worked please help me with code, how they have implemented would be really helpful for lot developers.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2018 05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2018 09:26 PM
Hi Ankur,
without using midserver Jira cannot consume the webservice call because JIRA is onprimse application and firewall will block servicenow webservice call.
connection cannot be established without using the midserver.
please let meknow how can I mive forward. I found lot of article about sending attachment using attachment API and none of the article is helpful.
there is no proper direction how to use the ATTACHMENT API for multipart/form-data. lot of community article just reposted the same old articles where there is no proper info about sending attachment to Jira.
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2020 09:25 AM
Hi Harish,
Were you able to achieve this requirement ?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2020 02:50 AM
Hi NamrataJain,
No we were not able to send the attachments to Jira.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2020 04:20 AM
Hi,
In a perfect world, you should be able to use this,
RESTMessageV2 - setRequestBodyFromAttachment(String attachmentSysId)
Write your script and done.
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();
But I have not been able to get this to work OOB. I believe Jira is only expecting a multipart-form/data message and ServiceNow is sending an application/octet-stream (i think). The only way I have been able to send attachments via REST is with the Mid server using a custom .jar file called from a script include.
Mark correct or helpful if this helps.
Thanks
Swapnil