Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

api rest php

Guy Roger KAMGUE FEUSSI
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2018

hello,

 

 i want to use the api of my jira to export all the ticket on the file Excel .csv

 

 

this is my code :

$username = '.........';

$password = '.........

$url = 'https://................................';

$curl = curl_init();

curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");

curl_setopt($curl, CURLOPT_URL, $url);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

$issue_list = (curl_exec($curl));

echo $issue_list;

i need your help,

 

thanx you :) :)

1 answer

0 votes
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 1, 2018

Hey, Guy!

I'm not a PHP programmer, but I can give you some information regarding Jira's API. Depending on how you want to search the issues and if you want one or a list of issues, you can use the below REST call:

Get the issue information with the Issue Key or ID(One issue at the a time): /rest/api/2/issue/{issueIdOrKey}

Get issues with a JQL query(List of Issues: /rest/api/2/search?jql={jql}

There are other REST calls you can use, which are all listed in the following documentation:

JIRA Server platform REST API reference

From this, you'll receive a response from Jira in JSON with all the issues and field values and you'll need to arrange them to save it as a CSV.

----

Also, you probably know this and you have other reasons to do this via the REST API, but Jira has a built-in export function. When you search for issues in the issue navigator you can click on "Export", then in CSV(All Fields) to generate a CSV file with all the list of issues.

Kind regards,
Maurício Karas

Suggest an answer

Log in or Sign up to answer