Automation Rule to display epic-link on a sub-task
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
- How to add the Epic Link field in the sub-task of a standard's issue type using an Automation Rule.
Environment
Jira Cloud
Diagnosis
- We need to create 2 Automation Rules, one for standard-issue types like a story and another one for sub-task.
- In order to display the epic link of the parent issue in the sub-task, before creating the Automation rule, you need to do the following:
1. Create a new text field "Parent Epic Name" and add this field to Story and Sub-task screens.
2. Rule1: For Story > copy Epic Link from Epic issue to the Story's "Parent Epic Name" field.
3. Rule2: For Sub-task > copy "Parent Epic Name" from parent issue to Sub-task's "Parent Epic Name" field.
Solution
- Rule1 is for Bugs/Stories (standard issue types):
When: Issue Created
If: matches
project = <projectname> and issue type in (Bug, Story)
Then: Edit issue fields
Parent Epic Name: Add the below smart values to show in the field
{{issue.parent.key}} - {{issue.parent.summary}}
===========
- Rule2 is for Sub-Tasks: (rule#2 will be triggered by rule#1)
When: Scheduled
project = <projectname> and issue type = Sub-task and CreatedDate > -2d and "Parent Epic Name[Short text]" is empty.
Then: Edit issue fields
Parent Epic Name: Copy parent Epic name from parent issue