Automation For Jira - How to create a rule that sums up the story points from sub-tasks of a parent issue
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article describes how to create an Automation Rule using the add-on Automation For Jira (for Jira Server/Data Center) meant to:
Calculate the sum of the Story Points field from all the sub-tasks of a parent issue (Story type issue, Task type issue, Bug type issue, etc...)
Copy that value to the Story Points field of the parent issue
Solution
Note that this implementation requires the configuration of 2 rules:
1st rule
The purpose of this rule is to update the Story Points of the Parent issue as soon as the Story Points of one of its sub-task get updated, by executing the operation "Parent Issue Story points" = "Sum of Story points from all its child issues"
2nd rule
The purpose of this rule is to handle the situation where a sub-task might be moved from one parent to another parent. In such case, the Story Points of the sub-task will be subtracted from the original parent, and added to the new parent
Configuration of the 1st rule
The rule will need to be configured as follows:
Add the Field value changed trigger with the following settings
Field to monitor: Story Points
Add an Issue field condition with the following settings:
Field: Issue type
Condition: Equals
Value: Sub-task
Add the following Branch rule
Type of related issues: Parent
Inside the Branch Rule, add the action below:
Edit Issue
In the Choose field to set menu, select Story Points, and paste the expression below:
|
Screenshot of the 1st rule:
Configuration of the 2nd rule
Add the Issue Updated trigger
Add an Issue fields condition with the following settings:
Field: Issue type
Condition: Equals
Value: Sub-task
Add an Advanced compare condition with the following settings:
First value:
|
Condition: "Does not equal"
Second value:
|
Add the following Branch rule
Type of related issues: JQL
JQL: copy the query below:
|
Inside this Branch, add the Edit Issue action:
Choose fields to set... :
Select the Story Points field
Copy the expression below:
|
Add the following Branch rule
Type of related issues: JQL
JQL: copy the query below:
|
Inside this Branch, add the Edit Issue action:
Choose fields to set... :
Select the Story Points field
Copy the expression below:
|
Screenshot of the 2nd rule:
Was this helpful?