We are trying to set up a Jira Automation that looks at Tasks assigned to Epics, and creates a percentage calculation for completedStoryPoints divided by totalStoryPoints.
All tasks have Story Points assigned.
We use 'Resolution' == 'Done' to determine how to calculate completedStoryPoints.
I have this working, but in two separate branches on the same automation rule. It appears the variables are deleted after the branch is still running, so this approach doesnt seem to work?
Please advise.
Hi @Sebastian Morton -- Welcome to the Atlassian Community!
When a variable is created within a branch, it normally only exists within that branch as that is its "scope". And so when you do this will multiple branches the values are not visible outside the branches.
There are a two things to try to solve your percentage completion measure:
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(resolution.name,"Done"))}}+{{Story points|0}}{{/}}{{/}} ) / {{lookupIssues.Story points.sum|0}} * 100, 0){{/}}
That works by iterating over the issues in the lookup, filtering on the ones in a "Done" resolution to sum their story points, dividing by the total story points, multiplying by 100 to get a percentage, and finally rounding the results to a whole number.
The second approach with filtering may be better / more predictable as it does not rely upon any scope "tricks" which could change in the future for the rule engine.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.