It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Downloading issue attachments via JIRA API in Java

I am creating a webpage where the user will be able to view the thumbnails of attachments for an issue, and when clicking on a thumbnail, the browser will load the attachment itself.

I can load all of an issue's details onto the page by using the API (e.g. the webpage shows the key, issue type, description, priority, attachment info, etc.), however the problem is that when I try to create a thumbnail for an attachment, it does not load the image in the browser. When clicking on that thumbnail to load the attachment, it redirects to the official JIRA page for the user to login.

This is the code on my webpage for loading the content, I am getting the content and thumbnail URLs from the JSON data returned from calling "GET /rest/api/2/issue/{issueIdOrKey}":

<a href="{{attachment.content}}">
	<img src="{{attachment.thumbnail}}" height="32" width="32" />
</a>

I understand this can be resolved once logging in via the official JIRA page, however my webpage already has a login page where the user enters their credentials and can then view issue details once successfully logged in, so I don't want users to log in twice. My webpage uses cookie-based authentication for logging in users.

Is there a way to resolve this so the webpage can load attachment thumbnails and content without requiring a second login?

1 answer

What are you actually trying to accomplish here? On a higher level? Maybe there is already an add-on in the Atlassian Marketplace. Or maybe you would be better off writing this as an Atlassian Connect add-on: connect.atlassian.com

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,082 views 7 0
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you