Iam adding 3 custom filed values and dividing with another custom filed value. It is working with dividing by lower value, but not with higher value.
Adding cf1+cf2+cf3 and assigning the value to an integer variable "number".
Ex - If the sum of cf1+cf2+cf3 is 6. If the cf4 value is 3, then works fine. If the sum of 3 variables are lesser , then it returns 0.0. Can you please help to fix this.
<!-- @@Formula:
double a = 0;
Object cf1 = issue.get("customfield_10203");
Object cf2 = issue.get("customfield_10204");
Object cf3 = issue.get("customfield_10205");
Object cf4 = issue.get("customfield_10207");
int number = ((cf1 != null ? Integer.parseInt(cf1.toString()) : 0 )) +
((cf2 != null ? Integer.parseInt(cf2.toString()) : 0 )) +
((cf3 != null ? Integer.parseInt(cf3.toString()) : 0 )) ;
a=number/((cf4 != null ? Integer.parseInt(cf4.toString()) : 0 )) ;
return a;
-->
<!-- @@Format:
numberTool.format("#0.0",value);
-->
Try replacing int and Integer, with double and Double.
Since a division of integer returns an integer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.