Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,466,911
Community Members
 
Community Events
176
Community Groups

Upload attachments on Jira through the REST API

Hi folks!

Is there a way to upload attachments on Jira through the REST API informing the content of the file as Base64 or binary, or any other way that is not the path of the file itself?

 

Regards,
Rodrigo Kondo Fernandes

5 answers

Hi @Rodrigo Kondo Fernandes

This is Syed - a pre-sales engineer @ Exalate

Have you considered an out-of-the-box integration solution for achieving a bi-directional sync between ServiceNow and Jira? Exalate takes the pain out of the DIY approach and provides you extensive ongoing support as well with a dedicated development team ensuring that all latest updates are compatible and do not, possibly, break the integration. 

Please feel free to review Exalate to see if it fits your needs or simply book a demo with us to explore your use case further.

Thanks

Syed

Hi, @Rodrigo Kondo Fernandes 

My name is Diana and I am a solutions architect at ZigiWave. You can easily connect Jira and ServiceNow. Our no-code integration platform ZigOps will help you achieve that in a matter of minutes. It allows the transfer of default and custom fields between the systems and syncs them in real-time. You can also upload the attachments you want. Our tools reads the schema dynamically and can transfer any fields.

If you want to see how it works in action: book a technical demo.

Hi @Rodrigo Kondo Fernandes

If you aim to integrate Jira and ServiceNow platforms it can be achieved using Marketplace 3rd party apps. They usually allow you not only to synchronize attachments of different types but also automatically create related issues in the other instance, and keep them in sync also when the data (like field values, statuses, or comments) change. These connections are unidirectional or bidirectional, meaning that all the work made in one platform, could be immediately visible on the second one.

As I'm part of the Issue Sync for ServiceNow team, if you have any questions about this product, I will be happy to assist.

Kind regards,
Kasia

0 votes

Hey @Rodrigo Kondo Fernandes

I guess, you've seen the REST API docs for uploading attachments, right? You can also check the cloud docs for multiple examples in various programming languages. They're all based on files since that's basically what Attachments are. But there are various ways how you could add the file contents, e.g. in Java you'd need to add a stream which wouldn't need to be based on a file.

Otherwise, the app @Radek Dostál suggested, should work for fine.

Cheers,
Matthias

PS: If you still encounter problems, you can also ask more dev-related questions in the Developer community: https://community.developer.atlassian.com/

0 votes

As far as I know Jira doesn't work with base64 file content (this and a few other search hits: https://jira.atlassian.com/browse/JRASERVER-60930)

 

Not sure about raw binary but it sounds.. extremely painful if you don't want to work with any files (how do you get the binary text if not from a file). I imagine there should be a way to do it  since the upload itself must work in some way for all attachment types anyway, but I don't know how to do it myself other than that it sounds like an absolute pain to do. Doing some curl -v -D- stuff with sample .png file for example shows a promising approach, but I don't know how to replicate the curl behaviour without spending a lot more time on this with more searches, and that also depends on which framework/language/library you're working with anyhow. I'm not that familiar with the details what goes into it.

Are you trying to do this from some intermediate point in between the user and Jira? Why else would file not be an option, it's the least complicated and least painful way to do it.

Hi @Radek Dostál !

It is being developed an integration between Jira <-> Service Now and the development is stuck on the sending attachments from Service Now to Jira.

I'm still not sure how the integration from Service Now to Jira is being made, but they are saying that they can't send the file, only the base64 content.

Well, in that case I'm afraid that's where my comfort zone ends. If Jira can't accept base64 format it'd have to be converted to binary as an intermediate step I think. This seems like a similar requirement with a solution https://community.atlassian.com/t5/Jira-questions/Jira-dosen-t-decode-base64-attachment-request-REST-API/qaq-p/916427

And from that seems like a free addon could be used to upload base64 attachments: https://marketplace.atlassian.com/apps/1221585/base64-attachment-upload-rest-api?hosting=datacenter&tab=overview

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events