Filter needed to show all Epics of an Initiative that a Team is contributing to

Jay LaVitola October 10, 2023

Context:

  • We have a Jira custom field called "Team" that indicates who is owning the work
  • In our Jira Ticket Hierarchy, Epics are under Initiatives

I'm looking to create a JQL filter for Team A to use for Jira Advanced Roadmap. I want them to see all the epics for all the Initiatives they are involved in, so they can understand where their work fits into the larger scope of all the Initiatives they are contributing to.

Example below, see image attached for reference

Team A has Epic 1 and the ownership is indicated through custom field of Team = "Team A".

Epic 1 rolls up into an Initiative Alpha (via parent link). Initiative Alpha is led by Team B. Initiative Alpha has a number of epics that roll up into it from a number of Teams.

How do I create a filter that returns the full list of Epics in any Initiative that Team A is contributing to (ie. has an Epic for). So In this case, I want the filter to return Epics 1, 2, 3.

ChatGPT suggest I add this to my filter, but it's not working as expected
- Addition suggested: issueFunction in linkedIssuesOf("Team = \"Team A\"", "is parent of")
- Current Filter: Team = "Team A" OR issueFunction in linkedIssuesOf("Subteam = 'Team A'")

 

Screenshot 2023-10-10 at 3.27.59 PM.png

3 answers

0 votes
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 11, 2023

Hi @Jay LaVitola

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.

However, as you appear to have the Scriptrunner app installed - this, I believe, is where the "issuefunction in" syntax is coming from (it's not native Jira) - mind trying the

portfolioParentsOf

function instead of linkedIssueOf?

I don't have Scriptrunner installed myself, but from the look of it,

issuefunction in portfolioParentsOf("Team = \"Team A\"")

might give you the right initiatives.

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.

Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 11, 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. Put simply, you'd create a sheet with all issues that are potentially relevant to you, model your issue hierarchy (that's just a couple of clicks), and then use JXL's filtering capabilities to narrow down to the issues that you care about:

initiatives-for-epics-for-teams.gif

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!

Jay LaVitola October 12, 2023

Thanks for the input Hannes. When using the JQL you sent me, I'm only getting the parents as opposed to the sibling(?) epics. Appreciate the suggestion though.

issuefunction in portfolioParentsOf("Team = \"Team A\"")
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 12, 2023

Mind trying

(Team = "Team A") OR (issuefunction in portfolioParentsOf("Team = \"Team A\""))

then?

0 votes
Danut M _StonikByte_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 10, 2023

Hi @Jay LaVitola,

It might not be possible to achieve this via a JQL filter.

A better solution would be to use the Work Brreakdown Structure (WBS) gadget offered by our Great Gadgets app. This gadgets takes the issues from a specified filter and displays them in a tree structure by their hierarchy Initiative > Epics > Stories, Tasks > Subtasks along with their status.

This way you can get a quick overview about the initiatives of each team. All you have to do, is to create a filter that returns the issues to be grouped (maybe one filter for each team) and then to configure the gadget to use that filter. 

This app offers many other gadgets that you will find useful; just have a look over our blog to see how many things you can track with this app. It can be a great asset for your team/company. 

I hope this helps. 

Thank you,

Danut Manda 

0 votes
Laurie Sciutti
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 10, 2023

Hi @Jay LaVitola and welcome!  The Team field in JQL resolves to a numeric ID (the same way sprints do when you search for them).   Find your team ID by searching for it separately and use the number that JQL converts it to.

 

In the example below, it will return all Epics assigned to Team 123 that is linked to an Initiative. 

issueFunction in linkedIssuesOf("type = Initiative")and Team = 123 and type = Epic
Jay LaVitola October 12, 2023

Thanks Laurie - However, I'm looking to return all the Epics (no matter what team owns it) for any initiative that Team 1 is involved in. Slightly different use case here.

Pierre Foucart
Contributor
December 5, 2023

@Laurie Sciutti I was interested by your comment as it would solve my problem but I get the following error message returned:

The "linkedIssuesOf" JQL function provided by "Adaptavist Scriptrunner" for Jira Server works differently in Jira Cloud. Run it directly in "Enhanced Search" instead. See the documentation for more details: https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-jql-keywords-functions
Laurie Sciutti
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2023

Hi @Jay LaVitola ~ apologies for the late response, I didn't get notified.  Include the Team info in the issueFuntion and it should give you what you need.

issueFunction in linkedIssuesOf("type = Initiative and Team = 123")and type = Epic
Laurie Sciutti
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2023

Hi @Pierre Foucart ~ I'm not familiar with the Cloud version of ScriptRunner but it looks like you need to run an initial synchronization and then use the Apps > Enhanced Search screen for this JQL.  ref:  https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-enhanced-search 

https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-enhanced-search/jql-functions 

Pierre Foucart
Contributor
December 6, 2023

I don't believe I have ScriptRunner it wasn't clarified in your message that it was used to display this query

Suggest an answer

Log in or Sign up to answer