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,074
Community Members
 
Community Events
176
Community Groups

How to select not done Jira tickets for a sprint but exclude certain epic and label?

Hi,

I am trying to write JQL that will allow me to select all those Jira tickets for the current active sprint that are not done and excludes certain epic (A-123) and label (XZY). 

This is what I have and it is not working.

Project = ABC AND Status != Done AND 'Epic Link' != A-123 OR Labels != XZY

 

Please help.

2 answers

Hey, try this:


Project = ABC AND Status != Done AND (('Epic Link' != A-123) OR (Labels != XZY)) AND sprint in openSprints () ORDER by Rank DESC

 

You had the OR part not but in brackets so it could give weird results - you specify you want issues from active sprints by telling JQL - get me issues in openSprints only :) 

 

Let me know if it works.

Thanks Marta. It did not work as my example had:

  • 12 issues in current active sprint
    • 1 issue with epic=A-123
    • 1 issue with label=XZY
    • 1 issue done

So the outcome should have been:

9 issues (out of 12)  left to do (12 - 3 = 9) , instead, I got 6 issues left to do....

Ismael Jimoh Community Leader Dec 05, 2022
(project = ABC and status != Done and sprint = '<your sprint id>' AND (('Epic Link' != 'A-123') OR (Labels != 'XZY')))


I am surprised that the suggestion from @Marta Woźniak-Semeniuk  above didn't work. Looking at your request, I would then search with the above structure.

If you still do not get what you want, then my suspicion is either, you have tickets that you believe match a specific parameter but do not and in this case, searching phase by phase (adding the next set of parameters after validating the prior returns the list of issues expected first) would be the way to go.

Regards.

Thank you @Ismael Jimoh 

Jira version I am using, a free version online, converts the query to this and gives the wrong result as mentioned above. It removes the brackets.

I don't add project as it is a quick filter on a Jira board.

status != Done AND sprint in openSprints() AND ("Epic Link" != HTS-5 OR Labels != Client)

status != Done AND sprint in openSprints() AND ("Epic Link" != HTS-5 AND Labels != Client) ORDER by Rank DESC

 

try this :)

Like Ismael Jimoh likes this

Thank you again. I did try and it gave me the wrong result. Also the brackets were removed by Jira.

Okay if you are using it as a quick filter for the board then the “sprint in openSprints()” part is obsolete as by default only current sprint tickets are visible.

Then it would leave
“status != Done AND “Epic Link” !=HTS-5 AND labels not in (Client)”
If the above is till giving wrong results, what is wrong with the results - does it show the done tickets too or the problem is with the epic/label?

Hi Safraz,

If this is failing, then it could mean the logic you have in mind and what you expect are not matching.

As we have no access to the tickets, I will go with my original suggestion of adding the next condition after validating that what you currently see is what you expect to see.

The question is which ones are failing. For example, with the current search, you will not get issues where Epic link is empty.

Here is a sample query I built that you can adjust:

project = "Sample scrum project" and Sprint in openSprints() and status != done and (("Epic Link" != SSP-7 or "Epic Link" is EMPTY) or labels != l1)

 

I had 3 issues, where one had the label mentioned, the other had the epic link mentioned and the 3rd had neither.

I successfully get just one ticket back.

I am using this query as a quick filter:

status != done AND ("Epic Link" != HTS-5 OR "Epic Link" is EMPTY OR labels != Client)

 

I have:

  • 12 issues
    • 1 done
    • 2 labels=Client
    • 1 epic=HTS-5

Should expect:

8 back but getting 10 instead (i.e. Labels are not working)

I think the != for labels might be the issue, there was a thread in the community about it once. Let's try with the 


status != done AND ("Epic Link" != HTS-5 OR "Epic Link" is EMPTY OR labels not in (Client))

0 votes
Ismael Jimoh Community Leader Dec 05, 2022

Hi @Sarfraz Aaron 

Is the Or operation checking if the issues are a part of the epic or are matching the epic.

Use brackets to combine and order operations in the order you want the search to be performed.

Ismael Jimoh Community Leader Dec 05, 2022

Another option would be building your query and validating you have the write list of issues first and then adding the next operator and conditions to filter down further

Hey @Ismael Jimoh the epic and the label are used together to isolate this particular vendor, as an example, where I have issues for the vendor epic or sometimes the issue belongs to another epic but has the vendor label to distinguish it.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events