Show Parent Issue in Hierarchy
Use the Show Parent Issue in Hierarchy to create a custom script field that displays an issue’s parent, where you define what parent means. This script field is particularly useful for Advanced Roadmaps for Jira users, although this feature is not limited to just Advanced Roadmaps.
For example, we have the following Advanced Roadmaps hierarchy:
Theme
Initiative
Epic
Story
Sub-task
You can use this script field to display the Theme issue type in all issue types below it in the hierarchy. We provide detailed steps on this below when explaining how to use this script field.
You can also query on this field, but it’s more effective to use portfolioChildrenOf.
Target issue type
The target issue type is the parent whose children will become targets for the script field.
Parent navigators
For each parent navigator chosen, this script field will attempt to find the current issue's parent using that method. We then continue to the next parent, and so on, until the desired issue type is found. For example, if we want every issue type below Theme, as shown in the hierarchy above, we would select the following Parent navigators:
- The Subtask Parent navigator for Subtasks.
- The Epic-Story navigator for Epics and Stories.
- The Portfolio Parent extractor for Themes and Initiatives.
In cases where multiple navigators return a parent, the first one in the list will display.
Using this script field
For the example below we use the hierarchy mentioned above. We want all issues to display the very highest parent issue in the hierarchy, which in this case is Theme.
- From ScriptRunner, select the Fields tab.
- Select Create Script Field.
- Select Show parent issue in hierarchy.
- Enter the name for the script field. In this example we enter Theme.
- Optional: enter a description. In this example we enter Theme this issue belongs to.
- Optional: add a field note. This is to help you identify your script field when viewing them all on the Fields tab.
- Select a Target Issue Type. In this example we select Theme.
- Select relevant Parent navigators. In this example we select Portfolio Parent, Links: Epic-Story Links, and Subtask Parent.
- Optional: enter an issue key and select Preview to preview this script field.
- Select Add.
- Configure the context and screens for this custom script field.
You can now test to see if this script field works as expected when added to your chosen project issues.