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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

Getting image content from Jira

I'm trying to extract image content from Jira using the REST API. Using the 'attachment' field I can get all the meta data about the image, including filename, size,mimeType, content Url, thumbnail url etc.

But I need to be able to download the image itself. Putting the content url into  a browser downloads the image ok, but only because I happen to logged into Jira.

So I'm using PHP CURL to download the image from this url and I'm hoping that the following code should do it:

$ch = curl_init($url);
$tempPath = '/tmp/jira_' . uniqid(true) ;
$fp = fopen($tempPath, 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch, CURLOPT_USERPWD, "$this->_apiKey" );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );


I'm using the CURLOPT_USERPWD in the same way I do when using the rest API, but the file is always empty. I'm assuming that this is an authentication issue. Can anybody tell me how I am supposed to authenticate?

0 answers

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events