The CreatorCon Call for Content is officially open! Get started here.

REST API attachments Transfer to JIRA

harishdasari
Tera Guru

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.

20 REPLIES 20

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Harish,

I have previously sent multipart form-data to external API from ServiceNow via Rest message and was able to send attachment to them

Following things I added to the http header:

Content-Disposition -> form-data

Content-Type -> multipart/form-data; boundary=AAA

Sample POST method content body:

--AAA
Content-Type: application/json
Content-Disposition: form-data

 

{

// your json body here

}

--AAA
Content-Type: ${contentType}
Content-Disposition: file; filename="${name}";documentid=1
Content-Transfer-Encoding: base64

${base64EncodedData}
--AAA--

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

 

I have created Headers for REST API like this. Jira is accept only Multipart-formdata. so now how can I send the attachment in the form of FILE. 

 

find_real_file.png

Hi Harish,

I think you need to send base64encoded data to them in post body.

Can you share your POST method body you are sending to them?

Regards

Ankur

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

Hi Harish,

Any update on this?

Regards

Ankur

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

Hi Harish,

Any update on this?

Regards

Ankur

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