-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Component/s: Work Item - Search - Backend - JVIS
-
None
-
2
-
Severity 3 - Minor
Issue Summary
When constructing a JQL search or filter excluding a particular parent epic, whether sub-tasks are returned or results or not varies depending on how the OR statement for "Epic Link"!= and "Epic Link" is EMPTY is arranged.
There is a known limitation using the != operator, as described in JRACLOUD-23030, where issues with an empty value aren't returned as a match for !=. The workaround for this is to use "Field != <value> OR Field is EMPTY"
Using this workaround with the Epic link field produces inconsistent results, depending on how the JQL is arranged. Adding "AND ("Epic Link"!= <epic> OR "Epic Link" is EMPTY)" to a search query returns no sub-tasks as results. But if the two "Epic Link" criteria are split up, then sub-tasks are returned.
The conditions are evaluated consistently for the story-level issues.
For example, the queries below are logically the same, but produce very different results in a JQL search for sub-tasks.
- (issuetype in (Task,Sub-task) AND "Epic Link" != XX-123) or (issuetype in (Task,Sub-task) AND "Epic Link" is EMPTY)
- returns tasks with no epic linked
- returns tasks with an epic linked that isn't XX-123
- returns all sub-tasks (parent issue can have no epic or any epic, including XX-123)
- issuetype in (Task,Sub-task) AND ("Epic Link" != XX-123 or "Epic Link" is EMPTY)
- returns tasks with no epic linked
- returns tasks with an epic linked that isn't XX-123
- returns no sub-tasks
Bonus confirmation that the != operator is the problem:
- ("Epic Link" is EMPTY OR "Epic Link" != XX-123) returns no sub-tasks.
- ("Epic Link" is EMPTY OR "Epic Link" = XX-123) returns all sub-tasks.
Steps to Reproduce
- Go to issue search
- Start with any condition (project, issue type, etc) that will include sub-tasks
- Add "("Epic Link"!= <epic> or "Epic Link" is EMPTY)" after the first condition and enter any epic in the != condition
- Search using this query, no sub-tasks will be returned
- Split the Epic link criteria, so you have "(start condition AND "Epic Link"!= <epic>) OR (start condition AND "Epic Link" is EMPTY)"
- Search again, this time all sub-tasks that meet your first condition will be returned as results.
Expected Results
Whether sub-tasks are included in the results should be the same no matter how you arrange the conditions, whether they evaluate as true for "Epic Link" is EMPTY or not shouldn't be affected by whether "Epic Link"!= is in the same OR statement.
Actual Results
In one arrangement all sub-tasks are included, regardless of their parent's epic, the other way no sub-tasks are returned.
Workaround
Use the parentEpic JQL function instead of the Epic Link field.
parentEpic != <epic> doesn't need to have an "OR is EMPTY" clause added, as a blank epic link is considered a match for != using this function.
Sub-tasks are also returned based on the Epic link value of their parent.
For details, see the documentation on the parentEpic function here: https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#parentEpic--