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

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

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).

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

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

 

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

0 votes

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.

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

3,015 views 8 7
View question

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