Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Searching/Sorting User Stories by quantity of labels applied

Alan_Conway
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2017

Hi there,

Ideally I'd like to sort my backlog by the number of labels in a Custom Field attached to a User Story. From the research/attempts I've done so far it doesn't look like this is possible.

What was provided to me by a colleague was the following JQL:

project = MT AND issuetype in (Bug, Story) AND "myCustomField" is not EMPTY

It would work for what I'm trying to acheive if I could swap out the above 'is not EMPTY' and replace it with 'is > 3' (as in contains more than 3 labels). 

If anyone could provide the correct syntax for what I'm describing it would be greatly appreciated!

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
July 10, 2017

There is no syntax for it, JQL for the custom field is built to look for values, not count up values.

I'd use one of the scripting add-ons to create a simple scripted field that displays "number of labels" as a numeric, so you can search and sort on that.  Don't even need to put it on the issue screens, as it's for searching only.

Alan_Conway
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2017

Thanks for the clarification!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events