ServiceNow Attachment to JIRA Integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 07:28 AM
We have created a custom solution for ServiceNow to JIRA Integration not using Integration Hub. We are unable to get attachments from ServiceNow into JIRA. We are able to pass the attachment name, but no attachment. We need some help getting this working properly.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 07:37 AM
Unfortunately this isn't a very straightforward task if you are not using IntegrationHub because **officially** that is the only way that ServiceNow supports outbound REST requests with type multipart/form-data (link).
There are ways around this though, the best method I have found is to use a recursive scripted REST API and the elusive response.getStreamWriter() method to add boundaries/multipart request stuff. Please find blog discussing this solution here.
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 09:02 AM
Thank you for your response. We continue to try and get further using your suggestion, but now we continuously get the error in our log file.
REST Msg Outbound - RESTMessageClient : Error executing REST request: attachment does not exist with sys_id: b64attachment: com.glide.rest.util.RESTRuntimeException: attachment does not exist with sys_id: b64attachment:
This based on trying to convert the attachment to a 64bit attachment.
var sa1 = new GlideSysAttachment();
binData = sa1.getBytes(gr);
b64attachment = GlideStringUtil.base64Encode(binData);
Every code change I make seems to lead to similar message where attachment does not exist with sys_id. When I check the sys_attachment table I find the current.table_sys_id is exactly the one I am trying to attach. Any other help would be appreciated. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2022 10:22 AM
Joe, perhaps something went wrong with the field mapping? We're using a custom solution, too, and haven't encountered issues. We use a tool called zigiops that allows us to transfer more than attachments between the two systems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 05:05 AM
Hi Joe,
Transfer of attachment from ServiceNow to any system shouldn't be a problem if it is encrypted /decrypted properly. It will be custom solution always as IntegrationHub is not used.
Please convert the attachment using GlideStringUtil.base64Encode and see if it generates the desired output towards JIRA.
Next step would be for JIRA to decode and read the attachment.
I hope that solves your problem.
If this answer is helpful please mark correct and helpful!
Regards,
Siddharth