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
- 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.

Step 2: Configure the Automation Rule
- Create an Automation Rule:
- Navigate to Project Settings > Automation and select Create rule.
- 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.

- 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

- Lookup Issues Under the Epic:
- Add a Lookup Issues action with the query:
Parent = {{issue.epic.key}}

- Create a variable to store the total count of issues under the Epic:
· Variable Name: varTotalCountSmartSmart Value: {{lookupIssues.size|0}}

- Lookup Completed Issues:
- Add another Lookup Issues action with the query for completed issues:
Parent = {{issue.epic.key}} AND status = Done

- Create a variable to store the count of completed issues:
· Variable Name: varDoneCountSmart Value: {{lookupIssues.size|0}}

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

- Within this branch, create a variable to calculate the completion percentage:
· Variable Name: varEpicCompletionSmart
Value: {{#=}}{{varDoneCount.asNumber}}/{{varTotalCountSmart.asNumber}}* 100 {{/}}

- 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)}}

Step 3: Display on Dashboard
- Create a JQL Filter:
- Create a filter to get all Epics from your project:
Project = XXX and Issuetype = Epic

- 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.


- The filter itself is also useful:

1 comment