Hi Team,
we are writing Jira automation for below, could you please help?
we are Testing to see if we can populate a % complete field to match progress in Jira.
we are facing some errors:
Unknown unary operator * at character position 6: 0 / * 100
Please see this article describing how to use smart value, list filtering: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
As some examples of how to do this operation in one expression...
Percentage complete by count, rounded to whole numbers:
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+1{{/}}{{/}} ) / {{lookupIssues.size|0}} * 100, 0){{/}}
Percentage complete by story points, rounded to whole numbers:
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+{{Story points|0}}{{/}}{{/}} ) / {{lookupIssues.Story points.sum|0}} * 100, 0){{/}}
Those expressions use list iterators, list filtering, and math expressions to accumulate the "Done" issue values and then divide them by the total, before rounding the result.
Kind regards,
Bill
@Bill Sheboy Thanks for the response, but still I didnt not understand it.
Do you mean I should add only one step for the % calculation?
'"
Percentage complete by count, rounded to whole numbers:
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+1{{/}}{{/}} ) / {{lookupIssues.size|0}} * 100, 0){{/}}
"
but in the screenshots I shared, what is the mistake?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you could use that expression I provided to calculate the percentage in one step to set the field.
I have not seen the .filter() syntax documented as an automation feature and so that appears to be one of the problems:
-- This does not work:
{{lookupIssues.filter(status = "Done").size}}
Instead use this to count the done issues:
{{#=}}0{{#lookupIssues}}{{#if(equals(status.name, "Done"))}}+1{{/}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.