I'm running into a query problem that I feel is a bug in JIRA's query language, but I am hoping I am wrong. Given the below query, the first line builds up a list and the 2nd should be filtering it down, which it does, but not as designed.
(filter = 23266 OR project in (WD, WC)) AND NOT
(component in (PBE) AND assignee is EMPTY)
ORDER BY Rank
My expectation for the above is that 2nd line would remove items found in the first line where the component is PBE and the assignee is EMPTY. It does this, but it is also removing items where the component is EMPTY and the assignee is EMPTY. Why?
It's a quirk of logic that humans find counter-intuitive, but when a multi-select field has nothing to work with when you say "field has X", it does not match. Null is not something you can compare with a value.
When you say "component in PBE", that clause ignores all empty components, because there is nothing for it to compare PBE with.
(component in (PBE) or component is empty) AND assignee is EMPTY
The above actually makes sense based on the result I'm getting back as it is saying take line 1 and remove anything where the assignee is empty and the component is empty or set to PBE.
I want the ones where assignee is empty and component is empty to remain, not be pulled out.
Ok, I think I misunderstood the question that you're trying to ask.
"Not" is quite a difficult thing for humans to process, and they can make building queries a lot harder to construct and read. Ideally, use them sparingly
Don't think about "taking away from another line" when you're building queries, always start with "how do I select what I want to see".
Having re-read your comments, I think it might be worth rephrasing the question, and hence the JQL.
I think you could break down your query into:
If that is the right question, then, the query becomes more intuitive:
(filter = 23266 OR project in (WD, WC)) and assignee is empty and not (component = PBE or component is empty)
I know that'll give the result for the question I've just re-written, but have I rephrased the question correctly now?
No I don't think you have. Here is what I want:
Ok, great, having it spelt out makes it easy to understand, and it's simple to get rid of the "not", making it the resulting query easier to understand. For this one, you can just forget the "I don't want" by just not selecting for it.
(filter = 23266 OR project in (WD, WC)) And ( (assignee is empty and component is empty) or (assignee is not empty and component = PBE) )
Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...
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