Is there a way to sort a column other than Desc and Asc?

Nannaakan December 1, 2016

Hi Sir/Madam,

 

using JQL I can arrange a list by DESC or ASC.

Using the command (e.g.) --> BY status DESC.

 

Is there any way I can sort a list of issues how I wanted to do - I want to arrange first all A, then Z, Then B, Then Y...

 

Is there a way to sort like this using JQL, I tried searching for the similar document but was not successful.

JIRA team had promised to use similar SQL query - So we tried the way how we do in SQL but I was not successful. Kindly let us know it is possible, If Yes what's next.

4 answers

0 votes
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2016

If you would want to do anything like what you describe in SQL, I suppose you would actually have to build separate queries, maybe add some dummy sort key field with a fixed value and then use that in a UNION of those separate queries to come up with your result. There may be some conditional options as well.

You would only be able to do the same thing in Issue navigator if you add a scripted calculated field that calculates this sort key for you, based on your conditional logic. And then sort by your calculated field.

However, you might be able to visualise you sort order in different ways too. If you get your issue selection on an Kanban board, you could use swimlanes to visualise a subset of the issues. You decide in what order you show the swimlanes on the board.

Or if you come to a point where you start building separate queries, you can use each separate query as the source for a Filter Results gadget on a Dashboard. Again, you decide the order in which the gadgets appear on your dashboard.

These are quite different options, more or less flexible - depending on your needs. It all comes down to what you are actually trying to achieve here.

Nannaakan December 2, 2016

We would like to go with SQL pattern even though there are multiple options.

UNION commands are not working like SQl. So what is the special change we need to do to access the same in JQL.

The command which I need in JQL is:

 

  1. Status = Open UNION Status = Open.

But this is not working.

The command given below are working fine:

 

  1. status in (Open, Defined)
  2. status = open

At this situation may I know how to use UNION commands

Nannaakan December 2, 2016

You have our requirement now, we need to know how to solve this in JQL.

0 votes
Nannaakan December 2, 2016

Hi Can you kindly look into it and let us know the possible solution for this...

0 votes
Nannaakan December 1, 2016

Hi Thanks,

 

But my question was different. The sorting needs to be done within one column in the order I wanted.

 

Lets take within assignee  ---> I have 6 names:

  1. Antony
  2. Benty
  3. Christy
  4. Xavier
  5. Yanky
  6. Zeena

First I want to sort like this:

Zeena, Antony, Yanky, Benty, Xavier and Christy. This is not ASC or DESC for the assignee, my own way of sorting. Can I achieve this by doing any JQL?

I can do this by doing some union in SQL. The JQL is sophisticated to do that....

 

0 votes
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2016

If I understand your question well, you want to combine sort order across different columns. You can do so in JQL like this:

Project = [Your project] ORDER BY assignee DESC, issuekey ASC

Status - which you mentioned in your question -  may trick you, as sorting is not alphabetical on status name, but on the hidden status id (which is not visible on screen).

Nannaakan December 2, 2016

Hi Thanks,

 

But my question was different. The sorting needs to be done within one column in the order I wanted.

 

Lets take within assignee  ---> I have 6 names:

  1. Antony
  2. Benty
  3. Christy
  4. Xavier
  5. Yanky
  6. Zeena

First I want to sort like this:

Zeena, Antony, Yanky, Benty, Xavier and Christy. This is not ASC or DESC for the assignee, my own way of sorting. Can I achieve this by doing any JQL?

I can do this by doing some union in SQL. The JQL is sophisticated to do that....

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events