Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

use jql api to search for problems

Alejandro Yudis Amaya Bonilla March 17, 2022

I need help I want to look for problems and that it shows me only the columns that I have decided but I can't find how I have my curl: curl --request GET \
--url '/rest/api/2/search?created+%3E%3D+2021-10-01+AND+created+%3C%3D+2021-12- 31+AND+project+%3D+LSD+AND+issuetype+in+%28%22Avianca+Sign+In+incident%22%2C+Incident%2C+%22Lifemiles.com+Incident%22%2C+%22Other+Services+Incident% 22%2C+%22PALM+Incidents%22%2C+%22QMS+Incidents%22%2C+%22Shopeo+incident%22%2C+%22iFly+Incident%22%29+AND+status+in+%28Closed%2C+Completed%2C+ Open%2C+Pending%2C+%22Work+in+Progress%22%29+AND+reporter+in+%285aa69c3cafb80a211be4bb71%29+ORDER+BY+created+ASC%2C+status+DESC%2C+updated+DESC' \

But it brings me a lot of data and many rows that I don't need, the only thing I need is
Issue key,Summary,assignee,report,status,severity,resolution,created,update,time to frist response

Capture.jpg

1 answer

0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 17, 2022

Hi @alejandro yudis amaya Bonilla 

I had the same requirement some time ago and found jq to filter json response. Please see the following link:

https://stackoverflow.com/questions/62595453/filtering-from-json-output-from-curl-using-jq

 

Hope this helps.

Best
Stefan

Alejandro Yudis Amaya Bonilla March 21, 2022

I have achieved it with this code:

 

jq -r '["Issue key","Summary","Created Datetime","Severity","Resolution","Status"], (.issues[] | [.key,.fields.summary,.fields.created,.fields.customfield_11374.value,.fields.resolution.name,.fields.status.name])| @csv' <File.json>
Like Stefan Salzl likes this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2022

AWESOME!!! happy you could make it work 💪

If your issue is solved please consider to click "Accept" next to the answer so that this case gets marked solved.

Best
Stefan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events