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?

2 answers

1 accepted

This widget could not be displayed.

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!

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())))


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!

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())

 

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 widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 11 hours ago in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

32 views 1 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