Searching/Sorting User Stories by quantity of labels applied

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 vote

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.

Thanks for the clarification!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted yesterday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

96 views 3 3
Join discussion

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