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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I create a filter to show me the entire backlog for my team?

Can anyone help me understand why my query isn't providing the expected results?

I'd like to create a filter to show me all tickets that are not in the current open sprint. We do have some placeholder sprints created that are used largely for organizing tickets before they're assigned to actual working sprints.

If I create the query the following way the parameters for scrum team and status are ignored in the results I get and I end up seeing a significantly higher number of results than I should:

"SCRUM Team (Agile)" = Revolution AND sprint IS EMPTY OR sprint NOT IN openSprints() AND status in (Open, "In Progress", Reopened, New, "On Hold") and project = Development

If I try to create the query based on tickets that are not in the active sprint I get significantly fewer results than I should:

project = BLUE AND status in (Open, "In Progress", Reopened, New, "On Hold") AND "SCRUM Team (Agile)" = Revolution AND Sprint not in openSprints()

This query also provides far too many results and seems to ignore the scrum team and status parameters.

project = BLUE AND status in (Open, "In Progress", Reopened, New, "On Hold") AND "SCRUM Team (Agile)" = Revolution AND Sprint not in openSprints() OR Sprint is EMPTY

How can I correct this? 

2 answers

1 accepted

1 vote
Answer accepted

I suspect this is about the clauses you are joining with OR. The usage of AND in a query is simple and intuitive, but OR is not. You need to look at the order and what joins what to what.

"A and B and C" will give you the same as "B and A and C", but "A or B and C" is a different question to "A or C and B", and nowhere near as easy to work out what it is doing!

I usually find it easier to use braces to explain it.

project = BLUE AND status in (Open, "In Progress", Reopened, New, "On Hold") AND "SCRUM Team (Agile)" = Revolution AND Sprint not in openSprints()

I would expect to be giving you an answer you understand.  But if I have understood your requirement correctly (be aware I'm not good at that!), I would change

project = BLUE AND status in (Open, "In Progress", Reopened, New, "On Hold") AND "SCRUM Team (Agile)" = Revolution AND Sprint not in openSprints() OR Sprint is EMPTY

to

project = BLUE AND ( ( status in (Open, "In Progress", Reopened, New, "On Hold") AND "SCRUM Team (Agile)" = Revolution AND Sprint not in openSprints() ) OR Sprint is EMPTY )

I'm less sure what to do with your first query as the project is different and the OR elsewhere but maybe

project = Development AND "SCRUM Team (Agile)" = Revolution AND (sprint IS EMPTY OR sprint NOT IN openSprints() ) AND status in (Open, "In Progress", Reopened, New, "On Hold")

So I'd try breaking up queries with braces and evaluating each brace-pair in turn.

I think this one did it! Thank you!!!

I'm going to dig through the results further and confirm. This provided about 500 results while all of the others gave either around 200 or 4,000+. I'm not sure why the project ended up different in one of the queries. For our setup when I let JIRA suggest the syntax it says Development (BLUE) so using either as project seems to give the same results. 

project = Development AND "SCRUM Team (Agile)" = Revolution AND (sprint IS EMPTY OR sprint NOT IN openSprints() ) AND status in (Open, "In Progress", Reopened, New, "On Hold")

Like Nic Brough _Adaptavist_ likes this
0 votes

You might try adding this to your queries:

Sprint not in openSprints() AND Sprint is not EMPTY AND Sprint not in closedSprints()

This should get rid of everything that's in closed sprints, too.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

5,557 views 6 21
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you