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

Still need help?

The Atlassian Community is here for you.

Ask the community

robotsnoindex

 

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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.

Environment

  • Jira Data Center Only (This article does not apply to Jira Server licenses)
  • Applicable Jira / A4J (Automation for Jira) versions:
    • Jira 9.11.0 and any higher version (this Jira version ships with A4J 9.0.1)
    • OR Jira 8.20.0 and any higher version, in combination with A4J 9.0.1 

Solution

Limitations of this solution

(warning) 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

  • Get the ID from the URL: it is custom field ID that is needed to configure the automation 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

      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

        "Parent Link" = {{triggerIssue.customfield_XXXXX}}
    • Edit Issue
      • In the Choose field to set menu, select Story Points, and paste the expression below:

        {{lookupIssues.Story Points.sum}}

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 Allow rule trigger in the Rule Details section:


Screenshot showing the rule


Last modified on May 24, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.