Forums

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

Jira Automation - Percentage Complete of Story Points with Filter for 'Resolution'

Sebastian Morton
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 31, 2024

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.


 

 

Screenshot 2024-12-31 103052.pngScreenshot 2024-12-31 103123.pngScreenshot 2024-12-31 103135.pngScreenshot 2024-12-31 103139.pngScreenshot 2024-12-31 103152.png

1 answer

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 Champions.
December 31, 2024

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:

  • First create the variable with a default value before the branch and then recreate it inside the branch again with the actual value.  For branches on one-and-only-one-thing (e.g., branch to parent), this will "shadow" and replace the value for use outside the branch.  For example:
    • action: create variable ABC with a value of 0
    • branch: to epic parent
      • ...
      • action: create variable ABC with the needed value
      • ...
    • ...after the branch the variable ABC will have the needed value
  • Or instead try one single lookup issues action with smart value, list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588  For example:
    • branch: to epic parent
      • action: lookup issues with JQL to get all the child issues: 
        • "Epic Link" = {{issue.key}}
      • the percentage complete of Story Points by Resolution would be this:
{{#=}}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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
10.1.1
TAGS
AUG Leaders

Atlassian Community Events