Display Epic completion percentage on Jira Dashboard
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
This page explains how we can create an automation rule to capture Epic completion percentage and save this value in a custom field. This can be used to show it on a dashboard gadget for all the epics in a project.
ソリューション
- Create a custom field of type Text Field (single line) and lets say it as Epic Completion and add it to relevant screens used by Epic Issuetype.
- Create an automation rule and add Issue transitioned trigger. Select Done status in "To Status" dropdown.
Note: We can use any other status which is considered as Closed on your project. Add a JQL Condition and use below query to execute this rule only for issues in hierarchyLevel = 0 (Story, Task, Bug etc).
hierarchyLevel = 0 AND Parent is not Empty
Add a Lookup Issue action with below query to get issue under an epic.
Parent = {{issue.epic.key}}
Create a variable to save total counts of Issues under an epic.
Variable Name: varTotalCountSmart Smart Value: {{lookupIssues.size|0}}
Add another Lookup Issue action with below query to get Done issues under an epic.
Parent = {{issue.epic.key}} AND status = Done
Create another variable to save total count of completed issue under the Epic.
Variable Name: varDoneCount Smart Value: {{lookupIssues.size|0}}
Add a Branch rule/related issues and select Parent. Under this branch create a variable to calculate and save epic completion percentage.
Variable Name: varEpicCompletion Smart Value: {{#=}}{{varDoneCount.asNumber}}/{{varTotalCountSmart.asNumber}}* 100 {{/}}
Add an Edit Issue action and select the custom field created in first step. Use below smart value to update the custom field value.
{{varEpicCompletion.left(5)}}
Create JQL filter to get all epics from the project.
Project = ABC and Issuetype = Epic
- Add a Filter Results gadget on a dashboard and select the create filter. Select the Epic Completion field to view it in the filter result gadget.