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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,555,285
Community Members
 
Community Events
184
Community Groups

How can I export to CSV the results of a search via the REST API?

I'm connecting to a Jira server with version v8.22.3#822003.

I'm doing this search:

https://informs.infoway-inforoute.ca/issues/?jql=%22Batch%20ID%22%20~%20BSCT-18060

And this search gives me a list of tickets. From there, I'm currently doing the following:

* Manually selecting the Export pull-down menu

* Selecting CSV (all fields)

 

I'd like to do the above via REST API to automate it. I can login and get a ticket via the REST API (using jiraone in Python). But I can't find what's the endpoint and payload to be able to download the result of a search.

2 answers

1 vote
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 08, 2023

Hi @Anibal Jodorcovsky  Welcome to Atlassian Community!

You can export REST API data into CSV using MS Excel. 

REST API result in JSON, you can convert JSON data into csv OR you can use below method to get JQL Data directly into csv. Any changes in JIRA Issue also get reflected in Excel file, no need to export again or run API again. 

Open MS Excel --> Select Data tab >> Select Data Source >> From Web >> Enter URL :- https://informs.infoway-inforoute.ca/issues/?jql=%22Batch%20ID%22%20~%20BSCT-18060 >> Press OK >> Enter Basic Auth or Web API token >> Power Query Editor will Open >> Click "List" >> Records will open >> Click "Into Table" >> Select Column/Fields which you want to add into your excel >> Press "Save & Close". 

Use Basic or web API.pngPaste URL Press OK.pngScreenshot 2023-04-09 121019.pngScreenshot 2023-04-09 121157.png

The thing is that I need to do some more postprocessing on the CSV file, so this Excel trick, although nice to know, does not help me. Once I get the CSV file (or xlsx file) I need to run some business logic on values obtained, and then update some other database we have. 

 

So, is there a way for me to be able to basically do what the image below does in the UI?

jiracsv.jpg 

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 09, 2023

@Anibal Jodorcovsky This Excel trick save your time, and you don't need to export JIRA into csv again and again. Map only your projects fields in column. This is a one time setup, next time you only need to click refresh data.

Above Screenshot feature is only available in JIRA. Using REST API you get data in json format. For CSV convert data into csv.

But I can't use Excel. My program is all in Python and I need to extract this information from Python, not from Excel.

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 09, 2023

Then you have to write a code in Python which convert JSON response into CSV. 

I don't have experience in python, you can wait for other community member response, someone definitely know about this issue.

This is weird. I have an email with another answer, which is correct, but I don't see it online when logging in to the website. Why would that be?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events