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

Unable to get/display icon using REST API

Geoffrey Rodgers March 5, 2013

Hi,

I've been successful in implementing a JiraRestClient project so far, but the one things that's been troubling me lately is the inability to view icons for issue types, priorities, statuses, etc.

I'm writing a WPF application to display issue information, and I want to display the issue type icon. In the XAML, I can have something like

<Image Source="http://..."/>

and that URI works, but the iconUrl coming from JIRA is "https" and is causing the image not to display.

Anyone else had this trouble? Is there a particular type of REST authentication that's necessary, or something else I need to do?

Currently, I'm using the following Authenticator:

RestClient client = new RestClient(); // using RestSharp

client.Authenticator = new HttpBasicAuthenticator(username, password);

If anyone's interesting, the full source code is on BitBucket:

https://bitbucket.org/grodgers/jiravu

Thanks in advance!

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
rkooiman July 5, 2016

I hope your already resolved this problem, but for future reference, here's what I found:

Attachments, icons and pictures in JIRA of any kind will not be accessible without authentication. This means that whatever URL you get in a REST call to JIRA, you won't be able to use it directly. You'll have to make your server download the actual contents of the URL with its authentication to JIRA, and then make the server show the client the files in their browser. All files need to be collected this way before then can be used. Direct downloads from JIRA are impossible without giving the authentication info to the client, which I would not recommend because of security reasons.

0 votes
Geoffrey Rodgers March 6, 2013

I've at least identified the problem, but I'm still not sure how to resolve it.

The particular icon images that are giving me trouble actually live on Confluence as attachments. If I supply the URL for one of the standard JIRA icons, no problems. So, I suppose the issue is my request for the image to JIRA gets redirected to Confluence, and I'm not authenticated with Confluence.

If anyone has an idea on how to handle this in a generic way (so as to allow anyone to use my application with whatever image URLs they reference in the JIRA administration settings), I'd love to hear it.

TAGS
AUG Leaders

Atlassian Community Events