how can i sort by the order of listing on my query?

Sarel Bar Ilan August 16, 2016

example:

key in (ISSUE-2, ISSUE-1, ISSUE-3)

 

will get me an output of:

  • ISSUE-1
  • ISSUE-2
  • ISSUE-3

 

while i would like the results to be sorted this way:

  • ISSUE-2
  • ISSUE-1
  • ISSUE-3

 

is there anything i can use to do that while using JIRA for Cloud?

 

UPDATE:

As for the reason i'd like the 'key' to be in the order i've dictated:

My original need was to have the ability to sort my results by

  • "Epic link1"
    • Task within the Epic1
      • sub-tasks of the task
  • "Epic link2"
    • Task within the Epic2
      • sub-tasks of the task
  • "Epic link3"
    • Task within the Epic3
      • sub-tasks of the task

 

After I've exhausted all my googling efforts in search for a solution I've reached the point where I thought about the following steps:

 

... ORDER BY "Epic Link"

Include 'key' and 'subtasks' filed as a column and export the results.

The output gave me the sorting order I desired by stringing the key followed by it's subtasks

Now I have an array of keys in the right sorting order.

I  presume I could add an extra field to each of these issues and sort by it but that won't give me the dynamic I need since it changes everyday.

 

Any thought?

 

 

4 answers

0 votes
Darryl St_ Pierre
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.
August 22, 2019

I have a user that's trying to accomplish something very similar - Search output/view for a project, displayed/sorted as Epic - Task - subtask(s) (in other words, grouped by Epic, then grouped by task associated with the Epic.

Does anyone know of a way to do this?

Kelly Arrey
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.
June 11, 2020

Late to the party but the Structure add-on by ALM Works supports this and a whole lot more.  We've used it for over 5 years and found it very effective.

Atlassian Marketplace page for Structure

Alex Borovkov January 10, 2021

@Kelly Arrey : can you provide more details on how Structure add-on allows you to sort the result?

Kelly Arrey
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.
January 10, 2021

Hi Alex, Structure makes this quite straightforward. You would:

  • define an "insert" generator with some JQL to pull in the epics you're interested in
  • define an "extend" generator to pull in stories etc under each epic
  • define an "extend" generator to pull in sub-tasks under each story etc

You can then define one or more views and sort on any column in the view.

I did a webinar which explains exactly how to do all of this.

Standard disclaimers apply: YMMV, deuces are wild, I have no association with ALM Works except that of a happy customer. :-)

Like Dave Rosenlund likes this
0 votes
rachel rutti July 11, 2019

i was trying to do the same thing.  Temporarily, i listed the Keys (tickets) in a query to replicate a spreadsheet people use.  i want the output to ORDER BY the order I put them in the query like the above request.  Still looking for this answer.

0 votes
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2016

If you write an Atlassian Connect add-on then you can put entity properties on every issue that define a unique sort order. That is quite a complicated solution to the problem however: https://developer.atlassian.com/static/connect/docs/latest/modules/jira/entity-property.html

What is the invariant that dictates your sort order? It is clearly not ascending or descending order.

0 votes
Deleted user August 16, 2016

Odd... but if that's what you want, there is probably something other than the Key that's driving the order you want. If so, include that field in the "report" and sort on it. Otherwise you can add an additional field called Order for example and sort on those values.

There is no manual moving issues up or down in the search capability. Another option would be to export the results to Excel and manipulate the order there.

Suggest an answer

Log in or Sign up to answer