Hi,
I'm trying to use JIRA Misc Custom Fields and IF statements to determine the following:
If Customfield_10104 = 1
and Customfield_10105 = 1
return 1
If Customfield_10104 = 1
and Customfield_10105 = 5
return 9
Basically i'm trying to replace an existing spreadsheet that uses X/Y calculations (i.e. bespoke non-logical calculations) but can't get the IF statement to work, i could return the value of the customfield, and customfield_10104 + customfield_10105 = total but this is just adding them together but i need it to return a bespoke answer...HELP!
Many thanks
Assuming your custom fields are number fields:
if (issue.get("customfield_10104")==1 && issue.get("customfield_10105")==1) return 1; else if (issue.get("customfield_10104")==1 && issue.get("customfield_10105")==5) return 9; return 0; //or any other default value
If your custom fields are text fields, you'll need to do text comparisons:
if ("1".equals(issue.get("customfield_10104")) && "1".equals(issue.get("customfield_10105"))) return 1; if ("1".equals(issue.get("customfield_10104")) && "5".equals(issue.get("customfield_10105"))) return 9; return 0; //or any other default value
or else first convert the customfield values to integers using Integer.parseInt(issue.get("customfield_10104"))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.