Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation rule to see the %progress of Epics based on the completion of child items

This article aims to share a solution for users who want to have a report or view of their epics and the percentage of the Epic based on the progress of the child work items, such as example 1, example 2. So far, to achieve this, it is necessary to export a JQL search and work on it in an Excel file or using a third-party app from the Marketplace. This page shows how to use an Automation rule to get it.

Step by Step

Step 1: Create a Custom Field

  1. Create a Custom Field:
    • Go to Jira Settings > Issues > Custom fields.
    • Click on Add custom field and select Text Field (single line).
    • Name it Epic Completion and ensure it is added to the relevant screens used by the Epic issue type.

      052088d0-6ee9-4639-aac0-34302a82d3a0.png

Step 2: Configure the Automation Rule

  1. Create an Automation Rule:
    • Navigate to Project Settings > Automation and select Create rule.
  2. Set the Trigger:
    • Add the Issue transitioned trigger.
    • Select the Done status in the "To Status" dropdown. You can choose any status that represents completion in your workflow.

      2.png

  3. Add a JQL Condition:
    • Use the following JQL to ensure the rule only applies to issues with a parent Epic:

hierarchyLevel = 0 AND Parent is not Empty

                    3.png

  1. Lookup Issues Under the Epic:
    • Add a Lookup Issues action with the query:

Parent = {{issue.epic.key}}

                    4.png

  • Create a variable to store the total count of issues under the Epic:

·       Variable Name: varTotalCountSmartSmart Value: {{lookupIssues.size|0}}

                    5.png

  1. Lookup Completed Issues:
    • Add another Lookup Issues action with the query for completed issues:

Parent = {{issue.epic.key}} AND status = Done
                   6.png
              

  • Create a variable to store the count of completed issues:

·       Variable Name: varDoneCountSmart Value: {{lookupIssues.size|0}}

                   7.png

  1. Calculate Epic Completion Percentage:
    • Add a Branch rule/related issues and select Parent.

      8.png
  • Within this branch, create a variable to calculate the completion percentage:

·       Variable Name: varEpicCompletionSmart
Value: {{#=}}{{varDoneCount.asNumber}}/{{varTotalCountSmart.asNumber}}* 100 {{/}}
                   9.png
                   

  1. Update the Custom Field:
    • Add an Edit Issue action and select the Epic Completion custom field.
    • Use the following smart value to update the field:

{{varEpicCompletion.left(5)}}

                  10.png

Step 3: Display on Dashboard

  1. Create a JQL Filter:
    • Create a filter to get all Epics from your project:

Project = XXX and Issuetype = Epic

                11.png

  1. Add a Dashboard Gadget:
    • Add a Filter Results gadget to your dashboard.
    • Select the created filter and ensure the Epic Completion field is visible in the gadget.

      12.png13.png
  2. The filter itself is also useful:

    14.png
      

1 comment

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2025

Hi @Rodrigo Goulart 

Thanks for your article.  Here are some suggestions to improve this rule-based solution approach:

 

The rule is triggered on Work Item Transitioned, and this is only one of the ways a change could occur to the calculated value. To cover the other cases, additional rules would be needed or one single, Scheduled trigger rule to update periodically.  The other cases include at least:

  • when a work item is added as a child to the Epic
  • when a work item is removed as a child to the Epic
  • when a work item is created with a parent Epic in one step
  • when a work item with an Epic parent is deleted
  • when a work item changes its type in such a way it no longer has a parent
  • when there is an Atlassian outage (which may not trigger some rules later), use a Scheduled trigger rule to catch up the values
  • etc.

 

The rule uses multiple Lookup Work Item actions with different JQL for different values. Rather than doing this, a single lookup with smart value, list filtering and a math expression may be used to calculate the percentage in one step.

 

Within the math expression, the saved variables are converted with asNumber.  The conversion is not necessary within the math expression as the values are assumed to be numbers. (For other usage, the variable text needs conversion.)  To learn more about using variables as number values, please see this article: https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Using-Created-Variables-as-Numbers/ba-p/2953116

 

After the percentage is calculated, it is stored as another variable.  Then it is assumed to be a certain format in order to display the left 5 characters.  While that will be limited to up to 5 characters, it will also show a varying number of significant digits, from 1 to 5.  Please instead consider using the ROUND() function in the math expression to manage the desired precision.

 

Putting some of those ideas together, and assuming the lookup result contains all of the child work items for a single Epic, the percentage to 2 decimal places could be:

{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name, "Done"))}}+1{{/}}{{/}} ) / {{lookupIssues.size|0}} * 100, 2){{/}}

When one wants the percentage based on another field than work item count, such as Story Points, that may be substituted and the list sum function used for the total in the denominator.

 

Kind regards,
Bill

Like Brita Moorus likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events