I am looking to enable simple equation which is being done easily in Excel :
- Current Score = (Weight % × Current Maturity Level number) / 5
- Target Score = (Weight % × Target Maturity Level number) / 5
i have around 14 blocks/epics that have the , current set up ,
- current and target maturity levels field as a dropdown list with five options "L1,L2,L3,L4,L5".
- Weight %: number field that has a specific number that indicate the weight of each epic example "11% per epic number 1
- current and target score filed : that is also numbers.
so if we consider i am selecting drop down in current maturity level as : L2 the equation should be calculate as example ( 11*2/5 = 4.4) and 4.4 should automatically reflect in the current score field.
so if we consider i am selecting drop down in target maturity level as : L3 the equation should be calculate as example ( 11*3/5 = 6.6) and 6.6 should automatically reflect in the target score field.
I have tried many automation rule, none has works as i am facing challenging converting the text field to number so the math would work, anyone can help ?
Last equations i have used and returned with error cannot convert to number :
- set the "Current Score" field:
<span>{{issue."Weight %".toNumber.default(0)}} * </span>{{if(issue."Current Maturity Level".value.equals("L1"), 1, if(issue."Current Maturity Level".value.equals("L2"), 2, if(issue."Current Maturity Level".value.equals("L3"), 3, if(issue."Current Maturity Level".value.equals("L4"), 4, if(issue."Current Maturity Level".value.equals("L5"), 5, 0)))))}} / 5
- Set the "Target Score" field:
<span>{{issue."Weight %".toNumber.default(0)}} * </span>{{if(issue."Target Maturity Level".value.equals("L1"), 1, if(issue."Target Maturity Level".value.equals("L2"), 2, if(issue."Target Maturity Level".value.equals("L3"), 3, if(issue."Target Maturity Level".value.equals("L4"), 4, if(issue."Target Maturity Level".value.equals("L5"), 5, 0)))))}} / 5
the following is the Log for the error showing :
Could not convert the field value to a number. Please ensure the value is a number, math expression or smart-value that can be converted into a number.
Current Score: set the "Current Score" field: * 2 / 5, Target Score: Set the "Target Score" field: * 4 / 5
Log
Weight %: 11.0 Current Maturity Level: L2 Target Maturity Level: L4