How to list specific JQL column first

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 Champion Mar 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.

Try this

assignee=currentUser() AND type!="Development Sub-task" ORDER BY status, updatedDate DESC
"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 Champion Mar 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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

290 views 3 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you