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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.