I'm trying to use a JQL Query Filter to display subtasks for specific users in my Scrum Board. For tasks I want to look at the 'Assignee' field but for stories, I want to refer to the 'QA' field (which is a custom field). So, I'm creating a query like:
project = DEV AND ((type = Story AND QA = user1) OR (type in (Defect, Development, QA, Sub-task) AND assignee = user1)).
I save the query and I see some results but they don't look right so I try to go back to the query filter and see the query. I see that it has been changed to:
project = DEV AND (type = Story AND QA = user1 OR type in (Defect, Development, QA, Sub-task) AND assignee = user1)
You will notice that JIRA has removed one pair of outer brackets. So, a query like ((A AND B) OR (C AND D)) is being changed to A AND B OR C AND D. I'll have to write out the truth table to confirm but I believe that these two queries will not produce the same results. Can somebody from Atlassian please review this and respond?
The best I can tell, Jira JQL gives precedence to AND over OR, so that
A AND B OR C AND D
is equivalent to
(A AND B) OR (C AND D)
I created the truth table for both queries and I DO see differences in the results. I'm pasting a screenshot of the truth table. Unless there's something else I'm missing here, I think Atlassian should review this functionality and ensure that it preserves the brackets exactly as the user specified them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I love this :) brings back memories.
Anyways for without parenthesis column what is your operator precedence - left to right or right to left?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, I found a bug in my Excel formula. I have redone the calculation and still see a mismatch. I'm pasting a new screenshot below for this.
In Excel, I used the following formula to simulate the L-to-R computation that Atlassian uses.
=AND(D2,OR(C2,AND(A2,B2)))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Sagar _Sparxsys_ you think it brings back memories? Imagine my plight...I graduated from college more than 30 years ago! I'm too old to even remember when I learned truth tables! Probably around 1985 or 1986!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah I am not old :p
If results are inconsistent then try creating a filter for sub queries.
The Atlassian documentation says L to R but your truth table says something else. I guess the parentheses are still respected (at least in most cases).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can follow this issue: https://jira.atlassian.com/browse/JRASERVER-39107
The results should not vary though but Jira does remove nested parenthesis. It is annoying to read your own JQL after few weeks and understand the logic.
Try creating filters for your sub queries and use it in the JQL like filter = "filter 1" AND filter = "filter 2". It will improve the readability.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Swaroop Rao
If you want someone from Atlassian to review this, you may need to raise a support ticket, but i would probably confirm via a truth table that it isn't working first.
My question is - if you have the query set up, with all brackets as you want them, before saving, what happens if you run the query? Do you get the expected results? Or does it automatically remove brackets, even without saving?
I tried a query with the same structure of brackets and ANDs and ORs, but prior to saving it ran and didn't remove brackets (returned 2471 rows). I then saved it and it removed both sets of inner brackets, but still returned 2471 rows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.