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,556,160
Community Members
 
Community Events
184
Community Groups

How to build a backlog filter query using JQL

I am trying to create a filter that will show me items that are in the backlog, but am having difficulty.  I hope that someone can help point me in the right direction, and that it is not an issue of JIRA lacking another feature that I need!

My current filter looks like this:

status != Done AND (Sprint not in (openSprints(), futureSprints()) OR Sprint is not EMPTY) ORDER BY createdDate ASC

If I change it to say only

Sprint not in (openSprints(), futureSprints()

then I get results that are not in the current sprint - exactly what I need.  The only problem is that it excludes items that have previously been assigned to a sprint, but were never completed.  If I change it to say only

Sprint is not EMPTY

then I get results that have been previously assigned to a sprint - again, exactly what I need!  The only problem is that it excludes items that have never been assigned to a sprint.

When I try to combine the two inside of a parenthesis grouping, I get most of what I need - but for some reason, it is including the items that are in my current (active) sprint.

I feel like this would all be solved by having Atlassian implement a simple "currentSprint()" operator, so that I could say

Sprint not in currentSprint()

Can anyone help me out - or am I out of luck?

4 answers

1 accepted

6 votes
Answer accepted
Boris Georgiev _Appfire_
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.
Feb 19, 2016

What about the JQL below ?

status != Done AND (sprint is EMPTY OR (sprint in (closedSprints())))

Should return all issues

  • NOT Done
  • Not in ANY sprint
  • OR
  • In sprints that are complete

Hi Boris, thanks for responding!  This definitely gets me much closer to where I need to be.  There are a few items that I'd still like to get rid of though; I see issues carried over from our last sprint (closed) that have been assigned to the current sprint.  I really appreciate you taking the time to reply!

Boris Georgiev _Appfire_
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.
Mar 01, 2016

So you want to exclude the items from the current sprint right ?

what about this query:

status != Done AND ((sprint is EMPTY OR (sprint in (closedSprints()))) AND (sprint NOT IN (openSprints())))


Like # people like this

Yes.  Essentially, I want to...

Include:

  • Items that have never been assigned to a sprint
  • Items that have been assigned to a previous sprint

Exclude:

  • Items in a "Done" status
  • items in the current sprint
  • Items in future sprints

It seems like the query above is filtering out items that have never been assigned to a previous sprint (i.e. sprint is EMPTY), but I actually need them to be included!

Thanks again for taking the time to respond!

Boris Georgiev _Appfire_
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.
Mar 01, 2016

Here's a query similar to the one above with some explanation:

sprint IS EMPTY OR sprint IN closedSprints()  AND sprint NOT IN (openSprints(), futureSprints()) AND status != Done

Include 

sprint IS EMPTY  OR  sprint IN closedSprints()
  • Items that have never been assigned to a sprint (sprint is EMPTY
  • Items that have been assigned to a previous sprint (sprint in closedSprints())

Exclude

sprint NOT IN (openSprints(), futureSprints()) AND status != Done
  • Items in a "Done" status (status != Done)
  • items in the current sprint (sprint NOT IN openSprints())
  • Items in future sprints (sprint NOT IN futureSprints())

 

Like # people like this
Boris Georgiev _Appfire_
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.
Mar 01, 2016

I've corrected my comment above - please try without all the brackets.

This is absolutely what I needed!  I owe you a coca-cola!  Thanks very much for your patience, and also for taking the time to explain it to me in crayon.  wink

Much obliged!

This definitely helps me as well !! Thank you..

Bumping to see if anyone else has another suggestion.  I would be surprised if I were the only one who needs a filter like this. I want to be able to setup a monthly subscription that emails folks with items in the backlog.  Am I missing something obvious?

I'm in the same boat.  It's absurd that I can't see what's in my backlog at a glance.  Right now I'm using this:

 

project = NAME and sprint IS EMPTY and status = open OR project = NAME and sprint IN closedSprints() AND sprint NOT IN (openSprints(), futureSprints()) AND status = Open

Hey @Adam Tiner 

I ran into this same issue and its been a while since you asked this question. I am posting this answer in case anyone else runs into this.

In order to target issues that are in your backlog but not within a future sprint, open sprint, or that was in a closed sprint but was unresolved use this query

Sprint in futureSprints() or Sprint is EMPTY or (Sprint in closedSprints() AND resolution = Unresolved and Sprint not in openSprints()) 

Now you will need to make sure to filter out all issues that do not have a status of Done or are unresolved

status != Done 
or
resolution = Unresolved

So the full query would look like this

Sprint in futureSprints() or Sprint is EMPTY or (Sprint in closedSprints() AND resolution = Unresolved and Sprint not in openSprints()) and issuetype in (your issue types here) and resolution = Unresolved

 

I hope there is an easier way of doing this but the only solution I could come up with. I hope this helps someone.

to me this works nicely project = NAME and  (sprint not in openSprints() or sprint is empty)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events