I have an OKR project in our Jira Cloud, that requires the calculation of some values. I have created Initial Value, Current Value and Target Value, and I'm using smart values in Jira Automation to calculate percentage of completion in a Score field, whenever one of the value fields changes. These are all Number fields visible on the edit screen.
The calculation was given to me as (Current Value - Initial Value) / (Target Value - Initial Value) * 100 (for the percentage).
I first attempted this as
{{#=}} {{issue.Current Value} - {issue.Initial Value}} / {{issue.Target Value} - {issue.Initial Value}} * 100 {{/}}error: Unknown unary operator * at character position 14: 3.0 - 2.0 / * 100
and then as
{{#=}} {{issue.Current Value.subtract(issue.Initial Value)}} / {{issue.Target Value.subtract(issue.Initial Value)}} * 100 {{/}}error: error: Unknown unary operator / at character position 1: / * 100
without success (current value 3, initial value 2, target value 4)
@Bill Sheboy @Daniel Eads can perhaps help here I hope