This guide demonstrates how to create a Jira automation rule that keeps epics and stories in sync with their parent issues. This is an example of a Branch rule component that applies actions to related issues, such as sub-tasks. This guide assumes you have an active Jira project.
In the Rules tab, click on the Create rule button at the top right corner of the screen. In our example rule below the Issue Transitioned trigger was selected.
On the Issue Transitioned screen, select the status trigger to execute a rule, then click save. In the below example the rule to be executed is "DONE".
Next, on the Add Component screen click the New condition option.
On the New Condition screen select Issue fields condition.
On the Issue Field Condition screen configure the condition to act on “epic” then click the save button. The configuration should look like the following:
Once you click the save button you will return to the Add component screen. The next component we will select is the Branch rule / related issues option.
On the Branch rule / related issues screen, select the branch rule type of related issues to Stories (or other issues in Epic) and then click the Save button.
This rule will now search if an epic has associated stories and perform actions on these instead of the trigger issue. Next, we will add a component underneath the For Stories branch. Select the New condition option.
On the New condition screen, select the Issue fields condition option.
Configure the Issue fields condition so the Status does not equal DONE. This ensures the rule only targets stories underneath an Epic with a status that is not done. The following illustration shows the configuration of the issue fields condition. Once configured, click the Save Button
Next, you can add New action to the new issue field condition. Click New Component on the left Rule details sidebar. Select New action on the new component screen.
We will use a Transition issue action for the New action. Select the Transition issue action to advance.
Configure the Transition the issue action to set the destination status from the trigger issue. This sets the story issues status to the parent epic. The transition issue action should look like the illustration below. Click Save to continue.
This fully configured the rule. The left sidebar Rule summary should look like the following:
Now you can add a name to the rule. Below we named the rule “Keep Epics and stories in sync”. Once you enter a name click the Turn it On button.
You can test the rule by going to your board and creating some issues. Create a new Epic issue and then a Story issue as part of the Epic. Change the status of the Epic to Done. Once you run this test exercise you can visit the rules page and check the Audit Log.
The audit log will indicate if the rule is completed successfully. You should see a green SUCCESS message. If not, the Audit log will also indicate if there are any errors with the rule and help debug.
Be sure to check out hundreds of other rules in our Automation Template Library.