JQL Filter issue by requesting status of linked epic

Kaan Coskun
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 13, 2023

I want to get all issues which hasn't their delivered by Epic in the status New.

I built this JQL:

project = SFCR AND component = DMS AND status = Open AND "Epic Link" not in (status != New)

but getting this error:

Error in the JQL Query: Expecting ',' or ')' but got '!='. (line 1, character 85)

2 answers

1 accepted

1 vote
Answer accepted
Hannes Obweger - JXL for Jira
Atlassian Partner
October 14, 2023

Hi @Kaan Coskun

just to expand on @Craig Nodwell's great answer:

Unfortunately, this is trickier than one might think; as a hierarchical query, it would really require some kind of join or subquery, which isn't available in plain Jira/JQL.

A few directions forward:

  • If it's a one-off thing, you could first query the relevant epics, and then use the keys of these epics in a second query, in an "parent in (KEY-1, KEY-2, ...)" clause.

If you want to run your search dynamically, without manually stitching two queries together, you'll need extra tooling:

  • You might be able to use Jira Automation to "propagate" epic information down to the epic's children, and then use the respective field(s) on the children to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. Scriptrunner has been mentioned before, but there are a couple of options.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case would be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

Hannes Obweger - JXL for Jira
Atlassian Partner
October 14, 2023

Just to expand on the last point, this is how this would look in the app that my team and I are working on, JXL for Jira:

parent-status-filtering.gif

(I'm using epic status "To do" here but it would work the same with "New".)

Once you have your list of issues, you can work on these directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!

2 votes
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2023

Hi @Kaan Coskun welcome to the community.  Your 'not in(status != New) is invalid.  Using the not in you list the statuses re: status not in(New,"To Do",Open)

Kaan Coskun
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 13, 2023

@Craig Nodwell Thank you for the reception!

How the whole JQL has to look like then?
I still can't figure it out, sorry.

Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2023

Out of the box jira won't give you those details.  Do you have any add-ons that provide issue functions for jql queries.  re: scriptrunner
The below example is using an issuefunction provided from the scriptrunner add-on.

issueFunction in issuesInEpics("project = SFCR AND component = DMS AND \"Epic Status\" != New")

Suggest an answer

Log in or Sign up to answer