Forums

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

Display Epic completion percentage on a jira dashboard

Marc Isikoff
Contributor
April 3, 2025

I am creating a dashboard and it has rich filters for epics.

I want to create a % completion number for each epic and show that in the dashboard view.

I followed the instructions on a support page for jira but it's cloud only: 

The gist though was to writer a trigger to update a custom text field on an epic when any non-Epic moves to Done and it has an Epic link that has a specific component, then creates two variables (count of all issues in epic, count on done issues in epic) and applies that to the custom text field.

I got it to work for the most part but it has an error that I don't think is cloud/server related.

In this step: 

Add a Branch rule/related issues and select Parent. Under this branch create a variable to calculate and save epic completion percentage.

1 2 Variable Name: varEpicCompletion Smart Value: {{#=}}{{varDoneCount.asNumber}}/{{varTotalCountSmart.asNumber}}* 100
I get an error: Error rendering smart-values when executing this rule: Unknown unary array operator / at character position 1: /* 100
In my automation I branch on Epic (parent) and use a create variable as described. The two custom variables are created earlier in the automation as directed

Link to the solution as given for cloud Jira: https://support.atlassian.com/jira/kb/display-epic-completion-percentage-on-jira-dashboard/

Let me know if you see any way forward and thank you!

3 answers

1 accepted

1 vote
Answer accepted
Marc Isikoff
Contributor
April 4, 2025

I made a couple of changes to the automation that met with success.

Effectively the answer was supposed to be 2/41 for 0.487 (which I got to show).

 

Changes:

1. Changed both created vars post lookup to be {{lookupIssues.size} without a |0 and logged them showing 42 and 2.

2. Changed the created var in the branch to remove .asNumber from each prior variable because this is Server version (DC) and saw that .asNumber might not work.

Anyway, this solved it for me and now I am looking to format it correctly as 48.7%

Marc Isikoff
Contributor
April 4, 2025

I think this answered my own question

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.
April 6, 2025

Thanks for the follow-up, Marc.  I forgot that asNumber is not supported for the Data Center version...and so variables cannot be used as numbers with the inline syntax: only the longer format math expressions.

1 vote
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.
April 3, 2025

Hi @Marc Isikoff 

For a question like this, context is important for the community to help.  Please post the following:

  • an image of your complete automation rule in a single image for continuity
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected and why you believe that to be the case

Until we see those...

 

That audit log error indicates your created variable varDoneCount is null, leading to the error.

The example rule in that knowledge base article uses the Lookup Issues action twice, and tries to extract the counts with this: {{lookupIssues.size|0}}

Did you include the default value at the end of the expression?

Does the audit log show any other errors?

 

Kind regards,
Bill

Marc Isikoff
Contributor
April 3, 2025

Thanks @Bill Sheboy for the quick reply.

GOAL: Use an existing text field to house a completion percentage on an Epic where we use the component "OKR".

jira automation.png

Both "And: Create variable" do use the Smart Value: {{lookupIssues.size|0}} so I'm unsure if that's what you asked.

automatioerrors.png

The issue 619 was the story I transitioned to Done to start the automation and 370 is indeed its Epic. The Associated issues are shown (not pasted here) and has about 42 issues in the epic and 2 are done so it lists them seemingly correct but maybe in the branch they are not accessible values?

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.
April 3, 2025

Hey, I just noticed this got posted as a App Central "discussion" rather than as a Jira "question".  Would one of the community leaders / managers please move it?  Thanks!

Back to the question...

I am using Cloud, not Data Center, and so I wonder if the default value operator with the pipe actually works for your version of automation.

The way to check that is to change your variables from:

{{lookupIssues.size|0}}

to

0{{lookupIssues.size}}

Then even when the lookup result is null, a 0 will be put at the front.

 

By the way...the audit log you show indicates both the of the variables are empty, indicating no issues were found by either lookup.

Have you confirmed that {{issue.epic.key}} as a value when it is used in the lookup JQL?

Please also post an image of your create variable action for varEpicCompletion.  Thanks!

 

Marc Isikoff
Contributor
April 3, 2025

@Bill Sheboy 

I made the switch as directed to 

0{{lookupIssues.size}}

but reran to no improvement. Same error.

When the automation rule is audited to show where the error is, the associated actions like Issue event, Lookup Issues and Branch/Rule related issues are shown with the Jira keys. The number of keys shown in each supports that it knows the issue that triggered, it looks up and finds the right number of issues in its epic, and the right number of 'done' issues in the epic as I can see how many are returned. 

The lookups use:

"Epic Link" = {{issue.epic.key}}

and

"Epic Link" = {{issue.epic.key}} AND status = Done

What I cannot tell is why the lookups that do show associated items that match the real numbers (e.g., 3 of 42 issues done) are not being put into the variable creations that occur directly after the lookup issues fires. 

And the declaration of the variable in the branch is below...varepicCompletion.png

Dave Rosenlund _Trundl_
Community Champion
April 3, 2025

Moved (as requested) 😎

Like # people like this
0 votes
Danut M _StonikByte_
Atlassian Partner
April 3, 2025

Hi @Marc Isikoff,

Using automation to populate a custom field with epic task completions could be an option, but it is pretty difficult to implement and prone to errors.

Do you consider the option of using a plugin from Atlassian Marketplace? If yes, our Great Gadgets app offer a Pivot Table & Pivot Chart gadget that allows you to display "% completion number for each epic and show that in the dashboard view" in form of table, heat-map table, or charts of various types. And this, with just a few clicks!

image.png 

image.png

See also this article on how to do it: https://community.atlassian.com/forums/App-Central-articles/How-to-display-the-progress-of-Epics-or-Initiatives-in-Jira-or/ba-p/2858840 

Danut.

 

Marc Isikoff
Contributor
April 4, 2025

Danut, sorry we are not open to Marketplace add ons. We need to use what we have which only includes ScriptRunner.

Suggest an answer

Log in or Sign up to answer