Jira REST Integration - How to send attachment?

garyopela
ServiceNow Employee
ServiceNow Employee

Again, many thanks to John James Andersen for his work on the Jira REST interface.

I have made a tremendous amount of progress on it, and have a heavily customized version of my own running for the Service Catalog. However, now the requirement has come up to send attachments from the catalog over to Jira.

 

John also had a nice write-up on how to get the attachments out of Service-Now here: http://www.john-james-andersen.com/blog/service-now/sending-out-servicenow-attachments-via-soap.html. I also found write-ups on how to insert attachments via REST to jira here: How do I upload attachment to JIRA Issue via REST API? - Atlassian Answers.


The problem that I'm seeing is that the first link, the data is returned in the raw format, whereas the Jira integration is expecting an actual file.

 

So, I was wondering if anyone had any suggestions on how to handle this?

 

My initial thought is to use Orchestration to kick off a perl script on my mid-server and pass it the sys_id of the RITM. Then the perl script would query the sys_attachment table and, for each attachment found, download the attachment and send it over to the Jira instance. This way Service-Now is the one who kicked off the whole thing, so it's not just sitting there running all the time.

 

Any suggestions are welcome

 

Thanks!

12 REPLIES 12

philippenguyen
Kilo Contributor

Hi guys,



Could anyone help me with the ServiceNOW <=> Jira attachment handling integration?   I'm currently using the POC update set from Anderson and I'm completely stuck on this part.



Thank you!


Phil


Can someone help to post attachment to JIRA from serviceNow using rest api.



Thanks


I have tried to debug code from another thread and works perfectly for me. I have posted complete solution code here - https://community.servicenow.com/community?id=community_question&sys_id=0679b3b0dbfeeb00f21f5583ca96...