Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to have String conditions in Calculated Number Field?

Emmanuel Bautista III
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 1, 2018

Is it possible to have String conditions in Calculated Number Field?

Please see below code:

<!-- @@Formula: 
double writeOffAmountFc = issue.get("customfield_19117");
double writeOffAmountUsd;

String currency = issue.get("customfield_10106");


if (currency == "IDR"){
writeOffAmountUsd = writeOffAmountFc / 13000;
}
if(currency == "THB"){
writeOffAmountUsd = writeOffAmountFc / 35;
}
if(currency == "MYR"){
writeOffAmountUsd = writeOffAmountFc / 4;
}
if(currency == "VND"){
writeOffAmountUsd = writeOffAmountFc / 23000;
}
if(currency == "RMB"){
writeOffAmountUsd = writeOffAmountFc / 7;
}
return writeOffAmountUsd;
-->

0 answers

Suggest an answer

Log in or Sign up to answer