Query that orders by sub-task rank

Mike D_
Contributor
March 19, 2020

I have a set of sub-tasks on a story that I've prioritized via drag and drop, top down priority.

How do I write a query that outputs these tasks in that order?

`parent = blah-123 order by rank` isn't working

 

Story w/ ordered tasks:

subtask order.png

 

Query results:


query results jira.png

4 answers

1 vote
Jack Brickey
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 30, 2020

@Mike D_, I successfully used parent = ag-11 order by rank to drive the results below. You will note the issuekey numbering is different that the JQL results which aligns w/ the parent detail view.

Parent detail view (ordered)...

parent detail view.jpg

JQL results...

ng-rank.jpg

Mike D_
Contributor
March 30, 2020

Hi Jack 👋 - I was able to get to work in a next-gen project too 👍

BUT, it doesn't work on classic projects.

Happy to invite you to my sample project 😊

 

Sidenote: your screenshots are super grainy and hard to read (maybe that was your intention though? 🤔)

Jack Brickey
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 30, 2020

Mike, sorry for the delay. It's Virtual Summit week.

So for me it does work for Classic but a bit different. Here is what I observed.

Create sub-tasks under a task that look like this...

here is the list of issues after i ranked (note the issuekey # vs. the summary #

ranked.jpg

Now if I use this JQL - parent = test-52 ORDER BY rank DESC, i get this...

jql ranked.jpg

 

NOTE: if you omit the Order BY rank altogether you also get the ranked list.

1 vote
Leonard Chew
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 26, 2020

Hi Mike

I think rank is what you are looking for, but if you want to change the rank, you need to create a jira board (to be able to change the position of the issues by drag&drop).

If you change the position with drag&drop on your query result without a board, it will change it on the screen, but not change the rank (e.g. after page refresh you will see the old order again), thats why you need to do it on a board.

So what you need to do:

  1. Save your query as a filter
  2. create a board with your saved filter
  3. change the position of your items on the board
Mike D_
Contributor
March 26, 2020

Hi Leonard,

 

>I think rank is what you are looking for

`parent = blah-123 order by rank` isn't working

 

>but if you want to change the rank

nope, not trying to that

 

My real goal is to get the story to show up in VS code like it does in the webapp but I can simulate that by querying in the webapp.

jira query.png

Mike D_
Contributor
March 26, 2020

I've updated my title btw.  I'm trying to order my sub-tasks.

(Just onboarded to Jira so I'm learning the correct language...)

Leonard Chew
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 26, 2020

how did you prioritize your items?

Mike D_
Contributor
March 26, 2020

I dragged them around in the story.

I should setup a test jira should so I show everything...

Mike D_
Contributor
March 26, 2020
Mike D_
Contributor
March 26, 2020

my test project is a "next-gen" project:

learning jira 2.png

Mike D_
Contributor
March 29, 2020

So it's a appears to be a bug with the classic projects:

jira order 1.pngjira order 2.png

Mike D_
Contributor
March 29, 2020

Happy to invite you to my sample project to troubleshoot, let me know!  Thanks!

0 votes
kriegaex
Contributor
September 22, 2023

FWIW, I am also missing the subtask sort order to be exposed to JQL in Jira Server, but my current use case is to clone subtasks in the original order via Java REST API. There, it is possible to obtain the subtasks in the expected order via

myJiraTool
.getRestClient()
.getIssueClient()
.getIssue('ABC-123').claim()
.getSubtasks()

and then iterate over the result.

The workaround to create a kanban board for each issue and to manually adjust the rank is way too tedious. It also will not be updated when the task order is changed in Jira, because that order does not correspond to the issue rank. Hence, that workaround is simply useless to me.

0 votes
Dominic Lagger
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 23, 2020

Hi @Mike D_ 

The rank is an internal ordering system from jira. If you want to order by the issue number just do it like this:

parent = blah-123 order by key

Hope this helped.

Regards, Dominic

Mike D_
Contributor
March 25, 2020

Thanks Dominic but that didn't work.  That orders them by the "ID":

blah-124

blah-125

etc.

 

Again, I've prioritized the sub-tasks in the story.  The story is sorting them.  How can I do the same thing?

 

Example story:

Story: blah-100

Subtasks: blah-105, blah-102, blah-110

The subtasks show up in that order when I open the story as I've prioritized them like that.

Mike D_
Contributor
March 26, 2020

I just created my own jira account and it is working w/ `order by rank` 😕

But I see one difference, in my work project, the label is "create subtask" not "add a child issue".

Maybe it's just a label difference or a difference in functionality? 🤔

 

I created some child issues and re-ordered them:

learning jira 1.png

 

Query:

learning jira 3.png

Mike D_
Contributor
March 29, 2020

Hi Dominic - did you get an alert about this reply?  Different thread so I wasn't sure... still learning this tool...

Dominic Lagger
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 29, 2020

Hi Mike, 

I get the alerts. But I'm not familiar with the next gen projects in jira. 

So I can't give any further help. I'm sorry about that. I asked other leader, if they can help. 

Regards, Dominic 

Mike D_
Contributor
March 30, 2020

Hi Dominic 👋,

>But I'm not familiar with the next gen projects in jira. 

It works properly w/ next gen projects.  It doesn't work with current gen projects, FYI.

>I asked other leader, if they can help. 

ok, thanks!

Like Dominic Lagger likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events