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?
Community moderators have prevented the ability to post new answers.
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")) { sw.Write(Encoding.UTF8.GetString(response.RawBytes.ToArray())); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, have a look to this ValueConverter I wrote:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks this is a big help. What we want is download all attach files in the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the get you are using to retrieve the binary data? I cannot find a REST call to get that information
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Can yo provide a sample on how to download the attach files? thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.