Jira Filter to display Stories in Board cause they are related to an Epic with a specific fixVersion
Asked by Karin Biedermann:

Hi guys

I have a question regarding JQL statements.

I have a Kanban Board which should display all Stories that are related to Epics with a specific fixVersion.

Example:

* Epic a - fixVersion 2404
  * Story aa - no fixVersion
  * Story ab - no fixVersion
* Epic b - fixVersion 2222
  * Story b - no fixVerison
* Epic c - fixVersion 2404
  * Story ca - no fixVersion

In this situation, my filter behind the board should display the stories related to epics with fixVersion 2404. This would mean, I should be able to see Story aa, Story ab and Story ca.

How can I build a JQL statement, that filters for a specific project and AgileObjects and fixVersion and includes all childissues EVEN if they do not have neither the AgileObjects nor the fixVersion.

I hope I was able to explain that understandable.

Thank you for your support


Answers:
author: Hannes Obweger - JXL for Jira
body: Hi [@Karin Biedermann](/t5/user/viewprofilepage/user-id/5421115),

welcome to the community!

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 ""Epic link" 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](https://www.atlassian.com/software/jira/features/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](https://marketplace.atlassian.com/) that can help with that. First, there's a number of apps that [extend JQL](https://marketplace.atlassian.com/search?query=jql) by additional functions, including hierarchy-related functions.
* Alternatively, you could try one of the more [hierarchy-focused](https://marketplace.atlassian.com/search?query=hierarchy) 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

comments: author: Hannes Obweger - JXL for Jira
body: 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](https://marketplace.atlassian.com/apps/1224710?hosting=datacenter&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2597304). Put simply, you'd create a sheet with all issues that are potentially relevant to you, enable the default issue hierarchy (that's just one click), and then use JXL filtering capabilities to narrow down to the issues that you care about:

![epics-by-label.gif](https://community.atlassian.com/t5/image/serverpage/image-id/269305iE8CCBE711F02A567/image-size/large?v=v2&px=999 "epics-by-label.gif")

(I'm using labels here, but it would work the same way with any other field.)

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!


author: Karin Biedermann
body: Hi [@Hannes Obweger - JXL for Jira](/t5/user/viewprofilepage/user-id/4289506)

Thank you for your response.

I could go with the first option, which would mean some manual work every PI but would be better than have to add fixVersions to every Story.

The automation would be nice as well but as far as I understand, automations can slow down the project quite a bit if there is a lot of load on it already. Do you know more about that?

Another app is probably not possible for me.

Kind regards

Karin


author: Hannes Obweger - JXL for Jira
body: Hi [@Karin Biedermann](/t5/user/viewprofilepage/user-id/5421115)

I'm not an Automation expert myself, but maybe [this](https://community.atlassian.com/t5/Jira-Software-questions/Automation-Add-parent-component-to-any-child-issues/qaq-p/2409051) could be a starting point?

Best,

Hannes


author: Karin Biedermann
body: thank you! Will try it out!


Tags: server