Automation rule to fetch the parent's parent issue key on the current issue

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Currently, we've an option to display the parent of an issue in the issue view, but not the parent's parent. This automation rule is devised to copy the summary/key of the parent's parent issue to a custom field in the current issue.

Environment

Jira Cloud

Solution

Consider the Issue type hierarchy is configured as below and the requirement is to show the Initiative issue key (Level 2) on the Story issue's custom field (type short text). 

#

Level Name

Jira Issue Type

2

Initiative

Initiative

1

Epic

Epic

Story

All other standard issue types

Sub-task

All sub-task issue types

Pre-requisite: Create a custom field of type Short text and add it to the screens associated with the Story issue type.  

Automation Rule Configuration: 

Trigger: Choose the trigger as per your requirement.  

Condition: Add a condition to check issue types if required

Select Add a condition and then IF or ELSE: Add condition options

Select Related issues condition and choose Parent under Related issues and Exists as the condition

Use action Create Variable, call it superparent and set the value to NULL. Variable is created here so it can be used in the Branch created in the next steps and also outside the branch.

Please refer to Automation for Jira - Create variable (New component) to learn more about this action.

Select Add a branch, Branch rule / related issues choose Parent under Type of related issues. 

Create Variable with the same name as before and use one of the below smart values to store the Initiative issue summary/key

1 2 3 {{issue.parent.summary}} - to get the summary of the parent issue OR {{issue.parent.key}}  - to get the key of the parent issue

Outside the branch, choose Add an action, Edit issue, select the custom field createdand use the below smart value to populate the Initiative issue key

1 {{superparent}}

Updated on March 5, 2025

Still need help?

The Atlassian Community is here for you.