Struggling with "label does not contain" (where one or more labels are present)

Iain McCarthy September 9, 2019

All the literature seems to be for the postive case "find this label or empty" but we're trying to flag issues where the label contains "anything BUT".

"Blocked By" is a custom label field, but I presume works with the same operators as the system label field. 

Something like this: 

"Team Assignment" = MyTeam AND "Blocked By" IS NOT EMPTY AND "Blocked By" NOT IN ("MyTeam")

We want to see results where: 

  • Blocked By = YourTeam
  • Blocked By = YourTeam, MyTeam

We don't want to see results where: 

  • Blocked By = MyTeam
  • Blocked By IS EMPTY

 

 

1 answer

0 votes
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 9, 2019

Hi @Iain McCarthy

"Team Assignment" = MyTeam AND ("Blocked By" != MyTeam OR ("Blocked By" = YourTeam and "Blocked By" = MyTeam)) 

^ Something like this is going to work - this provides all issues:

  • In the Team Assignment MyTeam
  • Which aren't blocked by MyTeam or...
  • Are blocked by both MyTeam and YourTeam

I think the difficulty here is how do you define the other teams? And how many are there? 

The other thing I wondered was if they're blocked by your team and their team - do these belong to another team also? So could you do something like:

"Team Assignment = MyTeam" AND "Blocked By" != MyTeam OR "Team Assignment" != MyTeam AND "Blocked By" = MyTeam

^ This provides both your own issues without blocked issues - and issues from other teams where you are reliant. Not sure if this matches up with exactly what you need though.

Let me know if either work or if not, how we can help further.

Ste

Iain McCarthy September 10, 2019

Thanks Ste,

I appreciate the suggestions. The trouble is there are many teams, and there doesn't appear to be a neat way of saying a label set "contains things other than x" in JQL.

In lieu of a function or operator, we've got something working based on the below.

Step 1: Define a Filter based upon [all other teams] which gives me the issues solely blocked by my team.

MyTeam_Blocks:

"Blocked By" = MyTeam AND "Blocked By" not in (OtherTeam1, OtherTeam2, OtherTeam3, OtherTeam4, OtherTeam5, OtherTeam6, OtherTeam7, OtherTeam8)

Step 2: Exclude the results of that filter in the query

"Team Assignment" = MyTeam AND "Blocked By" IS NOT EMPTY AND filter!=MyTeam_Blocks

This gives us the results we need, though there may be more efficient ways of accomplishing this! There would be a maintenance overhead, ongoing, as we'd need one of these per team in a set that may expand and contract.

Thoughts welcome, cheers!

Iain

Suggest an answer

Log in or Sign up to answer