How to list specific JQL column first

mikmas March 16, 2017

I have JQL query: assignee=currentUser() AND type!="Development Sub-task" ORDER BY updatedDate DESC

but i want to display status other than Completed first. Something like this:

assignee=currentUser() AND type!="Development Sub-task" ORDER BY status!=Completed, updatedDate DESC

how to do this?

2 answers

1 vote
Thomas Schlegel
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 16, 2017

Hi,

you are able to order by the status, but the order of the different status is determined globally in the administration page of the status. If you change it there, it will be changed on every Jira-Screen.

You can't change it in your query only.

0 votes
Niclas Sandstroem
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2017

Try this

assignee=currentUser() AND type!="Development Sub-task" ORDER BY status, updatedDate DESC
mikmas March 17, 2017
"assignee=currentUser() AND type!="Development Sub-task" ORDER BY status, updatedDate DESC"
I DON'T want to order by status literally, because i'll get something like this:
columns status, updated date
BBBBBB 2017-03-17
BBBBBB 2017-03-16
BBBBBB 2001-03-17
BBBBBB 1939-09-01
CCCCC 2017-03-17
CCCCC 2001-03-17
DDDDD 2017-03-17
DDDDD 2017-03-16
DDDDD 2001-03-17
Admit, that this is useless
I want to display first - for example - CCCCC and AFTER that all others ordered only by updatedDate so something like this:

CCCCC 2017-03-17
CCCCC 2001-03-17
BBBBBB 2017-03-17
DDDDD 2017-03-17
BBBBBB 2017-03-16
DDDDD 2017-03-16
BBBBBB 2001-03-17
DDDDD 2001-03-17
BBBBBB 1939-09-01

i can't explane it easier.

@ Thomas
What are you talking about? I want to create filter. How should it change something globally?
Thomas Schlegel
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, 2017

You can't sort status in a way you want to. There is a globally defined order of all the status in Jira.

If you sort your filter result by status, you sort it according to the global sort order defined by your JIRA administrator.

I don't think that you can achieve what you want, your sorting requirements are too complex and are not supported by Jira.

Andrey Koptelov November 16, 2017

You may try this:

1.
Create custom field "Field_for_sorting" - custom scripted field like "SIL Script Custom Field" (from free addon "Power Custom Fields")
or "Scripted Field" (from not free now "Script Runner for JIRA")

2.
on Edit page of "Field_for_sorting" set "Number Range Searcher" Search Template

3.
on Configure page of "Field_for_sorting" (for SIL Script Custom Field) make SIL Script for your needs.

example for your example:
if( status == "CCCCC") return 1;
return 2;

4.
do reindex all

5.
make your JQL with ORDER BY Field_for_sorting ASC,updated DESC
(you not needed to include Field_for_sorting in columns of filter results, just use in ORDER BY)

6.
be happy)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events