Automation rule | Update Parent Key value when issue is created

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

Summary

This article will help you set up an automation rule that should update the Parent Key value automatically according to your JQL query search result for Parent. Kindly ensure you are parsing the Issue Type in the JQL query that should only be one Hierarchy higher.

As per the standard setup hierarchy should be like the below :

Epic — Level 1

Story – Level 0

Task – Level 0

Subtask – Level -1

In this case, the Issue Type for the Parent should always be Epic for Task or Story issue type. Likewise, a subtask cannot have Epic as Parent; it should be either Story or Task Issue Type.

Solution

Here is the suggestion for automation rule setup:

Trigger : Issue created

If : Issuetype is equal to "Story"

Lookup Issue: JQL : project = TestPreoject AND type = Epic AND statusCategory != Done AND summary ~ BAU

Edit Issue : Parent

1 {{lookupissue.first}}

Please note that the JQL query may find more than one issue key. As you know, the Parent Field can have only one value. We are using "lookupissue.first" to select the first one from the search. Therefore, it is advised to have the JQL query for the Parent search as refined as possible to avoid multiple Issue conflicts.

Here is the automation rule snippet:

Automation rule snippet 1
Automation rule snippet 2

Updated on August 1, 2024

Still need help?

The Atlassian Community is here for you.