Custom sort order of jira workflow statuses in a filter using JQL
Asked Answered
H

4

13

I know you can change the order statuses are displayed by admin > issues > statuses and sort order but I'd prefer to order the results in my jql with certain statuses at the top and a specific order.

Is it possible to order how statuses appear in a query using JQL.

For example:

if you have the following status available:

  1. review,
  2. backlog,
  3. in development,
  4. testing,
  5. and Done

But you don't want to order them alphabetically can you define a customer order?

For example a JQL query for the custom order might be ORDER BY Status ("review","backlog","in development").

In this case the statuses would show from top to bottom on the Y axis in this order ("review","backlog","in development")

Hagiography answered 11/11, 2016 at 6:26 Comment(1)
I think this customized sort feature is even more important than before as in 2023 we don't seem to have an order of status but a workflow that is not explicit on any order.Munafo
S
2

ty for the question, that helped me find the solution it's simple you need to change the order of the status on the issues/statuses screen then, the normal sorting works

Silicic answered 14/1, 2022 at 18:13 Comment(2)
How do you do this if you're not an admin, only for yourself?Heideheidegger
Sorry that's the only way I found, I tried other ways but couldn'tSilicic
H
2

I haven't found how to exactly do it like the question asks, but I use ORDER BY statusCategory, status ASC for my filter. Works pretty well

Hemminger answered 20/7, 2022 at 8:21 Comment(1)
I get Not able to sort using field 'statusCategory'.Brittnee
L
1

In theory yes, you can make custom orders. I'm struggling to make it actually work though.

https://confluence.atlassian.com/jirakb/how-to-re-order-statuses-675385085.html

But your question indicates you already know about this feature. So I am not sure what you really want.

Laroy answered 31/5, 2019 at 19:8 Comment(0)
K
1

You will need administrator access to accomplish this. Forward this to your administrator if you do not.

As statuses get added to custom workflows, this can become an issue of occasional maintenance, and super useful.

When using ORDER BY priority DESC, status DESC you expect there to be a natural order.

Check the actual order in your project settings: https://sub.yoursite.org/secure/admin/ViewStatuses.jspa OR jira admin > issues > statuses

Here you will see a list of all your statuses. The state they are related to, and the natural order.

This is not drag and drop sadly. On the right you will see a pair of arrows, you can click to set position.

example of arrows in JIRA UI

Here is what it will look like

naturally sorted statuses in JIRA

TIP

This can get REALLY tedious, BUT if you perform a search in your browser for the title or description text (whichever is more direct), after your first click on an arrow perform the search again (command+g for my browser on my mac), and the result should land at the same place on the screen. You should be able to leave your mouse pointer where it is, then repeat until positioned correctly.

WARNING

This is a global change

Karie answered 1/5, 2023 at 14:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.