Display Epic completion percentage on Jira Dashboard
Asked by Bryan Urias:

Hello everyone,

I have followed the steps outlined in Atlassian's article [Display Epic completion percentage on Jira Dashboard](https://confluence.atlassian.com/jirakb/display-epic-completion-percentage-on-jira-dashboard-1384120605.html) to set up a custom field and automation rule for calculating epic completion percentages in our Jira Cloud instance, but I am unable to get the automation to work correctly, and accurately update the Epic Completion values.

I've added two different "Epic Completions" to verify it wasn't due to "read-only" attributes from my original text custom field.

Any insight on resolving based on the article's instructions and *not a third-party application* would be greatly appreciated! :)

![Epic Completion - Automation.jpg](/t5/image/serverpage/image-id/329507i896C2CF7C4DBFB90/image-size/large?v=v2&px=999 "Epic Completion - Automation.jpg")![Epic Completion - Correct Screen.jpg](/t5/image/serverpage/image-id/329508iE03FDCCA2087F8AC/image-size/large?v=v2&px=999 "Epic Completion - Correct Screen.jpg")![Epic Completion Custom Field.jpg](/t5/image/serverpage/image-id/329506i31CE50AB006ECAB8/image-size/large?v=v2&px=999 "Epic Completion Custom Field.jpg")


Answers:
author: Bill Sheboy
body: Hi [@Bryan Urias](/t5/user/viewprofilepage/user-id/5046085)

In my opinion, that Atlassian-written article is not super helpful at solving this scenario...particularly because it has some hidden assumptions and is quite inefficient.

Be that as it may...

If we assume it works, there may be a problem with one of the rule actions or the processing. Please review:

* each of your rule steps to confirm they match the article
* post an image of the final, Edit Issue action as something seems incorrect in the image you show
* confirm the case (i.e., capitalization) of the variables exactly match their use later in the rule, as smart values are case-sensitive
* confirm the created variables use the asNumber function to convert the text to numbers
* post an image of the audit log details to confirm the steps work as you expect...and if not
* write the values to the audit log to check the progress.
  * Specifically, I recommend writing each created variable to the audit log after they are created to confirm they contain what you expect.

Or as an alternative, try this rule:

* trigger: issue transitioned
* condition: issue type is one of Story, Task, Bug... (i.e., whichever types you assign to epics)
* condition: parent is not empty
* action: lookup issues with JQL of

```
parent = {{triggerIssue.parent.key}}
```

* branch: to parent
  * action: edit issue to set your field to this:

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

That percentage would be by issue count.

If you instead wanted the percentage by story points, please use this:

```
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+{{Story points|0}}{{/}}{{/}} ) / {{lookupIssues.Story points.sum|0}} * 100, 0){{/}}
```

Both round to whole numbers, so please adjust as needed.

Kind regards,  
Bill


author: Danut M _StonikByte_
body: Hi [@Bryan Urias](/t5/user/viewprofilepage/user-id/5046085),

This seems complicated and requires a lot of work.

Just be aware that this can easily done with the **Pivot Table \& Pivot Chart gadget** offered by our **[Great Gadgets](https://marketplace.atlassian.com/search?query=stonikbyte%20great%20gadgets%20agile)** app, without any manual work and complicated settings like the ones in that article!

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/329609i88CE67AD19181888/image-size/large?v=v2&px=999 "image.png")

You just have to configure the gadget with a JQL that returns the issues from your epics: *parentEpic IN (DEMO-1, DEMO-2)* , display the pivot table by *Status Category* and *Epic Link* fields and calculate by percentage of rows. And the table will be displayed on your dashboard, showing the data in real-time.

Hope this helps.

Danut

comments: author: Bryan Urias
body: Hello Danut,  

Thanks for your reply! While the recommended *third-party application* does what I am looking for, I am trying to set the same thing up with Atlassian's guide + automation, but seem to encounter an error along the way. Have an awesome day!  

Best regards,

Bryan


Tags: cloud

jira-cloud