Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,095
Community Members
 
Community Events
176
Community Groups

Filter issuess with multiple labels on with JQL

Hey Folks!

I have been searching for a way to JQL a query which will list all issues with MORE than one label added to it.

I cant find a way.

I know how to filter issues with the labels I want, for instance label = something but what if I want a list of issues that have more than 1 label. I got like 30 labels.

Any guidance is much appreciated!

Thanks!!!

I am on JIRA 8.5.4 btw

2 answers

1 accepted

2 votes
Answer accepted
Clark Everson Community Leader Feb 02, 2021

Hi @Fer ,

 

Welcome to the community! Using JQL you wouldn't be able to do this generically (i.e. label is x and ahs more than 1 label) . Label's is not a numerical field and the entire field is global, so if you want to do it you want have to make the filter pairs

lets say you had Label A, Label B, Label C

You would need to do a JQL for the combos

so

(labels = Label A AND labels = Label B AND labels = Label C) OR (labels = Label A AND labels = Label B) OR (labels = Label A  AND labels = Label C) OR (labels = Label B AND labels = Label C) etc

 

Otherwise you would need to do a database search, from the database itself or via tool like scriptrunner

Oh thanks so much for your detailed response! This is great.

Well, due to the ammount of labels I got (around 30) I believe I wont be able to apply the pair solution. I will check scriptrunner! Thanks!!

I used the following with 4 labels, slightly shorter than the above:

 

project=XYZ AND (
(labels=A AND labels in (B,C,D)) OR
(labels=B AND labels in (A,C,D)) OR
(labels=C AND labels in (A,B,D)) OR
(labels=D AND labels in (A,B,C)) )

Hi there, I tried this and it worked very well : 

project = XYZ AND labels in (label1, label2, label3) 

Hi Asma,

the original question was how to find issues with more than one label, but your solution will also return issues that have just one label out of the entire list within the parantheses.

In my case for example, the labels would be for teams or departments: dept1, dept2, dept3, and I want to find all issues where more than one department is involved and show them during a cross-department meeting.

Hi,

I am trying with multiple labels and it is not working. If I keep label=Feedback, it works but not with multiple labels. Pls help

project = ABC AND labels in (Feedback, Process Change, Engagement) AND status not in (Completed, Done, Cancelled) ORDER BY Summary ASC, updatedDate DESC

This seems to be unrelated to the original question, you want to find a single label, while the original question was to filter tickets that have more than one label. The filter should only return tickets that have two or more labels, but not tickets with just one label.

Yes, but I am looking for solution. If someone can help, I can use it.

"Process Change" needs the quotes, because it has whitespace. 

You should build up your queries step by step, and make sure they get the green checkmark. Use Autocomplete! 

Suggest an answer

Log in or Sign up to answer