Finding Epic's Parent (Finding the Parents Parents)

Melissa C
Contributor
January 3, 2025

Hello, 

Looking for ideas and suggestions from the experts!

Background: 

My company uses Initiatives, Epics and Tasks. We link Epics to Initiatives, via a parent link, making Initiatives the parent. In Epics we add Tasks.  The idea is that Initiatives is the overall project and Epics are all the things that need to be completed to finish the project.  Tasks are the minor things that have to be completed in order to complete an Epic. 

Requirement:

I have a jql that will give me Tasks for all the Epics. 

project = NNN AND summary ~ "\"Publish\"" AND issueFunction in issuesInEpics("status in (Approved) ") AND resolved >= startOfWeek() AND updated <= endOfWeek() ORDER BY updated ASC

This gives me the publish Task for each Epic with the status of Approved in the last week. 

For these I know the parent which is the Epic Link. 

I need to know who is the Parent (Initiative of the Epic), from the list I can click on the Epic Link, which will open the Epic and I can see the Parent in the "Parent Link" field.  

How can I do this through a jql or via automation?  

Any suggestions, clues would be greatly appreciated!

 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

Hello @Melissa C 

So you have the list of Task.

The result set doesn't include the parent Epics.

You want the result set to include the Initiatives that are parents of those Epics, but not the Epics. So the result set would have Tasks and their grandparent Initiatives.

Are you trying to get the Initiative key to display on the same line as the Task, or do you want the Initiative to be included as a separate item in the results set?

If the latter...

It appears that you have access to ScriptRunner for extended JQL functionality. You could use epicsOf() and portfolioParentsOf() to get the parent Initiatives of the Epics.

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/portfolio#portfolioparentsof

(project = NNN AND summary ~ "\"Publish\"" AND issueFunction in issuesInEpics("status in (Approved) ") AND resolved >= startOfWeek() AND updated <= endOfWeek())

OR

(issueFunction in portfolioParentsOf("issueFunction in epicsOf("project = NNN AND summary ~ "\"Publish\"" AND issueFunction in issuesInEpics("status in (Approved) ") AND resolved >= startOfWeek() AND updated <= endOfWeek()")") and issuetype=Initiative) 

ORDER BY updated ASC

 

I don't have an environment where I can actually test that out. I'm not sure if ScriptRunner for Jira DC allows that sort of nesting of functions. If it does not, you may have to save filters and build it up in layers:

Filter1=

project = NNN AND summary ~ "\"Publish\"" AND issueFunction in issuesInEpics("status in (Approved) ") AND resolved >= startOfWeek() AND updated <= endOfWeek()

Filter2 =

issueFunction in epicsOf("filter=Filter1")

Filter3 =

issueFunction in portfolioParentsOf("filter=Filter2")

Final filter =

filter=Filter1 or filter=Filter3

Suggest an answer

Log in or Sign up to answer