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

Specify custom order of fields returned from JIRA REST API using cURL


I want to be able to specify the order of the fields returned from my JQL query. Some fields are custom fields and by default, they return in order of ascending custom field ID, which I don't want. I'm trying to output this to a spreadsheet, so I would like certain fields containing multiple entries to output to the last column, which avoids shifting all the other columns around.

My command is:

$ (curl -u user:'password' -X GET 'url/rest/api/latest/search?jql=project=KEY&maxResults=200&fields=summary,customfield_11003,customfield_11001' | sed 's/{"expand":/\\\n/g') > output.csv

I want this to output:

summary, customfield_11003,customfield_11001 in that order, i.e., not ascending by field ID.

Instead it outputs:


I've tried simply inputting the desired order, using the order by command, using various delimiters, and various combinations of the field command. I'd like to avoid renaming the custom fields, as that is not a viable solution for our team.

Any help is appreciated - thanks!

1 answer

1 accepted

1 vote
Answer accepted


You can not specify an order. You should parse JSON programmatically and produce any order you need.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Managing Incidents - The roof is on FIRE!

The roof is on FIRE… network outages, broken processes, upset clients and employees. Each day seemed to bring more and more issues. Incidents were communicated via email, messengers (skype or teams) ...

121 views 0 1
Read article

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