Need to count or sort by number of labels.

Andrew Stuart November 27, 2019

This question appears to have done the rounds with most answers being about buying an addon or creating a script. 

I've noted that in JQL you can ORDER BY labels and this will alphabetise one way or the other. However I need to sort by the number labels either as a count or by sorting the results.

 

2 answers

1 accepted

0 votes
Answer accepted
Ignacio Pulgar
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.
December 3, 2019

Hi Andrew,

Unfortunately, there are no native ways to get what you need: an app or script would be required.

As a workaround, you may:

  1. Go to the issue navigator and save as a filter the query you would like to order by labels.
  2. Ensure the Issue Key and the Labels fields are being shown in your selected columns.
  3. Export the results to Excel CSV (current fields only):
    _labels.PNG
  4. Open the resulting CSV file with a text editor and replace all commas (,) with semicolons (;). Save the changes.
  5. Open the modified file with Excel and add a new column titled #Labels. Use the COUNTA(<range>) function to count the number of non-blank values under any of the labels columns within the very same row:
    excel.PNG
  6. Click on the cell where you have just added the COUNTA function, then click on its bottom-right corner and drag & drop it down to the last row in the spreadsheet. That way, your formula will be copied to the remaining rows, but updating the range conveniently.
  7. Click on Data > Filter so that the buttons with the dropdowns appear on all column headers, and click on said button from the #Labels column header to select the order based on that value.

You may also filter data to hide rows (issues) that do not match your desired requirements.

Finally, you can also easily create a comma-separated list of issue keys from Issue Key column and paste it in a JQL like issuekey in (<your  comma-separated list of issue keys>), so that you can execute a filter in Jira that gets the issues you want and continue interacting back with those issues within the tool.

Hope it helps.

Andrew Stuart December 3, 2019

Thanks @Ignacio Pulgar . I had already done the workaround you suggested. Odd you can do a Zendesk ticket count and not a label count. At least I have a definitive answer that what I specifically want can't be done without an additional app or script.

Like Ignacio Pulgar likes this
Eric Cabot November 25, 2020

@andrew.stuart how do you do the Zendesk ticket count ?

0 votes

I just made a filter searching for a specific set of labels, Then added the Two Dimensional Filter Statistics Widget to a dashboard. Configured it to use Labels as one of the Axis. And now I have a count of each label.

Suggest an answer

Log in or Sign up to answer