Jira REST API view/download attachments

Hello, I'm wirting a C# app that talks with Jira using REST API 6. I manage to do everything I want, but when I try to display images (using their URL) attached to Issues I cannot do that, because the "user" (my app) is not logged in.

So, is there a way to get the attachments as binary data, or a way to bypass autenthication for attachments? Or to get the real full URL from the server?

4 answers

1 accepted

1 vote
Answer accepted

Ok, I figured out it by myself!

Stupid mistake: I just didn't understand that I needed to request the file with another GET request and then decode the stream to file!!

using (var sw = new StreamWriter(@"path-to-where-i-want-to-save-the-file"))

hi, can you provide sample for this? thanks

Hey, have a look to this ValueConverter I wrote:


thanks this is a big help. What we want is download all attach files in the issue.

What is the get you are using to retrieve the binary data?  I cannot find a REST call to get that information

0 votes
Timothy Chin Community Champion Oct 22, 2013

because the "user" (my app) is not logged in

Then you need to log yourself in. There's oAuth and basic auth.

or a way to bypass autenthication for attachments?

Create a user that has permission to all issues? And I don't think there's a way to just bypass that.

Have you tried streaming the attachment using the content attribute?

Hey maybe I was not clear, I do autenthicate, that's how I get the attachment url: https://developer.atlassian.com/static/rest/jira/6.0.1.html#id150787

But then, as I use the attachment url, let's say of a picture, inside a picture box it won't show because it's like an anonymous user trying to see the file, for the server since the url is jira/secure/....

What do you mean by streaming?

Hi, Can yo provide a sample on how to download the attach files? thanks

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: https://www.icloud.com/keynote/0RyJ4VEdNUpjDpGfMhfZx9fEg#Confluence_Security_Advisor More details: https://co...

43 views 1 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you