Automation For Jira - How to create a rule that sums up the story points from epics to a parent initiative

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 Lookup Issues action available in Automation for Jira from the version 9.0.1, which will perform the following actions:

  • calculate the sum of the Story Points field from all the Epics linked to an Initiative

  • copy that value to the Initiative Story Points field

If you are trying to sum up story points from Story issues to a linked Epic, this KB article does not apply. Instead, you will need to refer to the KB article Automation For Jira - How to create a rule that sums up the story points from stories to an epic.

Solution

Limitations of this solution

Please note that with the suggested rule, the sum of the Story Points will only be updated in the Initiative when the Story Points field of 1 linked Epic is updated.

As a result:

  • If an Initiative is created and linked to Epics after these Epics were already given Story points, this rule will not run. It will be necessary to manually update the story points of a linked Epic to trigger the rule, which will then copy the sum of Story Points Sum into the Initiative

  • For any Initiative/Epic issues created before the rule was configured, the Story Points will not be automatically add to the Initiative. It also will be necessary to manually update the story points of a linked Epic to trigger the rule, which will then copy the sum of Story Points into the Initiative

Preliminary steps

Before configuring the automation rule, you need to first identify the ID of the Parent Link custom field, since this ID will be different depending on the Jira environment:

  • Go to ⚙ > Issues > Custom Fields

  • Search for the Parent Link custom field, and click on ... > View

Parent_link custom field
  • Get the ID from the URL: it is custom field ID that is needed to configure the automation rule

Get ID of the custom rule

Rule configuration

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 fields condition with the following settings:

    • Field: Issue type

    • Condition: Equal

    • Value: Epic

  • Add the following Branch rule

    • Type of related issues: JQL

    • JQL: enter the JQL query below, after replacing XXXXX with the ID of the Parent Link custom field

1 key = {{triggerIssue.customfield_XXXXX}}
  • Inside the Branch Rule, add the 2 actions below:

    • Lookup issues

      • Insert the expression below in the JQL field, after replacing XXXXX with the ID of the Parent Link custom field

        1 "Parent Link" = {{triggerIssue.customfield_XXXXX}}

    • Edit Issue

      • In the Choose field to set menu, select Story Points, and paste the expression below:

1 {{lookupIssues.Story Points.sum}}

Refer to the below screenshot to check the rule preview

Screenshot of the rule

If you are planning to use this automation rule in combination to the other automation rule (described in this article) which is meant to calculate the Sum of Story points from Stories and update the Epic Story Points, make sure to tick the option "Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule" under Allow rule trigger in the Rule Details section:

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.