Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

JIRA SERVCIENOW - MIGRATION with REST API

andrewjeun
Tera Contributor

I need to call the JIRA API to download files and save them into ServiceNow’s sys_attachment table.

However, I am running into the following issues:

  • When using getBody() from RESTMessageV2, the file is returned as a string, and binary files (images, PDFs, etc.) become corrupted.

  • When attempting to use getStream(), I cannot properly read the file stream in server-side scripts.

  • Even when trying GlideSysAttachment.write() or writeBase64(), the saved files are corrupted.

I need a reliable method to:

  1. Download a file from JIRA via API.

  2. Preserve its binary content correctly.

  3. Save it into the ServiceNow sys_attachment table without corruption.

Could you provide a sample or recommended approach for this scenario?

2 REPLIES 2

NavinAgarwal
Mega Guru

Hi @andrewjeun ,

 

Please review below KB article and see if it will help to resolve your problem..

 

Method to get attachments from JIRA to ServiceNow - Support and Troubleshooting

 

If you found my response helpful, could you please mark it as ‘Accept as Solution’ and ‘Helpful’? This small action goes a long way in helping other community members find the right answers more easily and supports the community.

Ankur Bawiskar
Tera Patron
Tera Patron

@andrewjeun 

did you check API documentation what's the response coming as?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader