We are trying to clean up the labels used on a project; I would like to find a way to see a list of issues that have a label that is NOT in a set of labels that I specify.
For example, I want to find all issues that have any label that is not one or more of (foo, bar). Some issues might have 2 labels, such as (foo, zing). I need to find all issues that contains any label that is not foo or bar.
I think you'll need to name the list explicitly, one clause at a time.
labels != foo AND labels != zing AND labels != bar AND ....
Thanks, but that doesn't work either. In this case, it won't find an issue with (foo, zing) because the labels comparison, apparently, matches ANY label on a task. Here, if I want to find any issue with zing, but filter on (labels != foo AND labels != bar), an issue containing foo will cause the AND construct to return FALSE. (By Jira's behavior, labels does = foo.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hang on, that's not what you asked for.
"I want to find all issues that have any label that is not one or more of (foo, bar)"
The search "label != foo and label != bar" will exclude those, and all you need to do then is add "and label is not empty". That will answer the question presented.
Or is the original question not quite right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for circling back, but I'm not quite sure how else to frame the question.
At a high level, I want to find a list of issues that contain any label not in a list of "approved" labels. In my example, I want to find any issue that contains any label other than "foo" or "bar", but I won't know what "unapproved" labels someone might have entered. If someone applied the "zing" label, I need to find it. (Logically, I need to express "issue has any_label NOT one of [foo, bar]".)
With your suggested test, it won't find (foo, zing), since it will fail the "label != foo" comparison.
Does this clarification help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, yes, I think it explains what I was not getting.
You don't care if foo or bar are on the issue, you want to find issues that have a label other than foo or bar.
In Jira terms, the starting point is "labels is not empty". But then you want to exclude issues where the labels are only foo, bar or foo and bar.
I can't think of a neat way to to that, because the logic of "not" means you get "not <statement>" not "not <isolated statement>"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup, that's it.
I'm beginning to suspect what I want to accomplish isn't possible using JQL.
Someone suggested doing an export of the issue list, and running a script over that, to find the issues that contain "unapproved" labels. That's my last resort. If anyone else has any other outside-the-box solutions for my use case, that would be most appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You would need to write a JQL like that
labels not in (foo,zing)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, tried that, but it doesn't work. In your example, it wouldn't find an issue with (foo, zing), since its "foo" label matches--it is in (foo, zing).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.