I need a JQL for my backlog items but excluding a certain label

Dalton Crawford September 7, 2019

I am currently cleaning the backlog and have tickets sitting with a label for review. I do however want to pull the rest of my backlog in a JQL so I can use Miro import to create a map. The problem is working through backlog queries I am not getting my magic number of items in the backlog. My query looks like this

(Project = Dev AND sprint is EMPTY AND Status != Done AND issuetype != Epic AND issuetype != Subtask And labels is EMPTY or Labels != Review) OR (project = _DEV AND sprint in closedSprints() AND sprint not in (openSprints(), futureSprints()) AND status != Done AND labels is EMPTY or Labels != Review)

The query itself is ugly and excludes subtask and epic, because even though I state it needs to be dev project the query breaks and pulls from my other boards as well. I just need from my dev environment. 

I know the quick and dirty fix is to just assign a label to backlog items and pull that unique label. But I should know how to get the items I want with JQL and without grunt working labels on. 

 

TLDR: I need backlog items (That are only tasks and stories) out of a single project(_Dev), minus a singular label(review).

 

1 answer

1 accepted

0 votes
Answer accepted
Ste
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2019

Hi @Dalton Crawford

Would something like this work?

Project = DEV and status != Done and issuetype in (Task, Story) and (labels is EMPTY or labels != Review) and (Sprint is empty or Sprint in closedSprints())

^ What I've done is:

  • Dropped to one query - based on your TLDR, you mentioned needing to see all Tasks and Stories so I've made this inclusive to both queries
  • Enclosed the OR statements - this is because it activates for all text after the OR - so the above example would be three different search queries - not one encased query considering all parameters.

I tried the negative searches here as well on my instance (eg Sprint not in openSprints()and Sprint not in futureSprints() in place of Sprint in closedSprints) and came up with the same numbers each way.

Ste

Dalton Crawford September 7, 2019

The return is only 7 tickets. I ended up going with the label to keep moving forward, but I want to understand this jql. 

Ste
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2019

Hi @Dalton Crawford

Sorry I pressed Reply a little early - see above for new answer.

Ste

Dalton Crawford September 7, 2019

This is closer, the only problem this has is that there was some rollover from past sprints. 

Some editing and I got to this 

Project = DEV and status not in (Done, "In Progress") and issuetype in (Task, Story) and (labels is EMPTY or labels != Review) and (Sprint is empty or Sprint not in opensprints())

 

and I got my magic number, and its correct. Thanks for your help @Ste 
I understand JQL a bit more. 

Ste
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2019

Awesome, glad I could help :)

I envisaged that the option you have could also include issues from Future Sprints - worth checking in case you need to limit the number further for future reference.

Ste

Like Dalton Crawford likes this
Dalton Crawford September 7, 2019

That makes sense, further implementation will probably have a necessity for that. 

Like Ste likes this

Suggest an answer

Log in or Sign up to answer