Automation For Jira - How to create a rule that sums up the story points from stories to a linked epic

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 version 9.0.1, which will perform the following actions:

  • Calculate the sum of the Story Points field from all the stories linked to an Epic

  • Copy that value to the Epic Story Points field

Solution

Limitations of this solution

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

As a result:

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

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

Rule suggestion

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: Story

  • Add the following Branch rule

    • Type of related issues: Epic (parent)

  • Inside the Branch Rule, add the 2 actions below:

    • Lookup issues

      • Insert the expression below in the JQL field:

        1 "epic link"={{issue.key}}

    • Edit Issue

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

        1 {{lookupIssues.Story Points.sum}}

Screenshot showing the rule

Rule details

Updated on June 6, 2024

Still need help?

The Atlassian Community is here for you.