JIRA Structure finding parent of parent of linked issues

AMIT GULATI
Contributor
January 16, 2025

Hi Community members,

I need some help in finding the below

I have an objective issuetype which is linked with one or more feature/epic thru a "relates" link. I want to find out the value of a field of parent (Portfolio epic) of parent (Program epic) of above feature/epic.

I am able to find the linked issues using issueLinks array but unable to figure out the way to find parent of parent of the elements of this array.

Any help is appreciated

 

 

3 answers

0 votes
Stepan Kholodov _Tempo_
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 17, 2025

Hello @AMIT GULATI 

Here is how you can extract a parent issue's value and show it for its sub-issue:

1. If both the parent issue and the sub-issue are added to the structure, and one appears under the other, then you can simply use a formula like this: parent{field value}

This formula can work in multi-level hierarchies as well, and you can extract values of grandparents and other ancestor issues using the level modifier: parent#level=-2{field value} would be for the parent from 2 levels above, parent#level=-3{field value} would be for the parent from 3 levels above.

To add all issues in the structure and display them as a hierarchy, you can use Extend generators, and configure them to the types of links that connect issues. However, as @Dmitry Astapkovich _Colined_ already mentioned - the 'Relates' link is unreliable for creating hierarchies in Jira due to it not giving users an opportunity to define which one of the linked issues is a parent, and which one is a sub-issue. If the hierarchy you want to have consists of more than 2 levels, then you should definitely either use a different link type, or rename the inward/outward directions of the 'Relates' link so they would be clearly distinguishable from each other.

2. If not all issues are present in the structure, it is only possible to extract values from a directly linked issue. I.e. if you have the 3-level hierarchy: A -> B -> C, and you only have issue type C in the structure, then you can only extract values from issue type B using the Formula column. In this set up, it's not possible to access values of issue type A (for this, you would need to add issue type B to the structure).

For extracting values of directly linked issues, you can use a formula like this:

On Data Center:
issuelinks.filter($.type = "link type name").map(if $.destination = this: $.source.fieldname else: $.destination.fieldname)

On Cloud:
issuelinks.filter($.type = "link type name").map(if $.destination = key: $.source.fieldname else: $.destination.fieldname)

Please note - in Structure Cloud, the list of accessible attributes via issueLinks function is limited at this time.

I hope this helps. If you need further assistance here or if you have other questions about Structure, please reach out to us directly at our support portal.

Best regards,
Stepan
Tempo (the Structure app vendor)

AMIT GULATI
Contributor
January 21, 2025

Thank you Stepan. I am using JIRA Data Center. In the example you gave,  

issuelinks.filter($.type = "link type name").map(if $.destination = this: $.source.fieldname else: $.destination.fieldname)

can fieldname be the parent issue?

0 votes
Dmitry Astapkovich _Colined_
Atlassian Partner
January 16, 2025

Please keep in mind that "Relates" is a symmetrical link, where both ends have the same name. Therefore often times Parent is set incorrectly:

SCR-20250117-hy7.png

0 votes
Prosper Agwegiokhe January 16, 2025

Hi @AMIT GULATI,

Welcome to the Atlassian Community!

I’m a support engineer at Appfire, here to assist you.

If you're open to plugin suggestions, I recommend trying our JQL Search Extension for Jira. We offer several helper functions that can simplify your query.

If you are trying to find the parents of parents:

  • Cloud: Use the query:
    issue in parentsOfIssuesInQuery("{issuesToFind}")
  • On-Premise: Use the query:
    issue in parentOf("{issuesToFind}")

For more details, refer to our documentation or contact our support team. We're always happy to help!

Best regards,
Prosper

Suggest an answer

Log in or Sign up to answer