You have 2 good options of doing so:
Example of how you can do that using the 2nd option (1st option is similar):
<!-- @@Formula: String issueType = issue.get("issuetype").getName().toString(); if (issueType.equals("Task")) { return issue.get("customfield_12600"); } -->
why this code work only for the first condition.
For other condition it is not working.
<!-- @@Formula:
String issueType = issue.get("issuetype").getName().toString();
if ((issue.get("customfield_13027").equals("L")) && (issueType.equals("Money Market")))
{ return issue.get("customfield_10010"); }
else if ((issue.get("customfield_13027").equals("B")) && (issueType.equals("Money Market")))
{ return ((issue.get("customfield_10010")) + (issue.get("customfield_10013"))); }
else if (issueType.equals("Forex Spot"))
{ return issue.get("customfield_12371"); }
else if (issueType.equals("Cash against account"))
{ return issue.get("customfield_12406").toString(); }
else if ((issue.get("customfield_12413").equals("REPO")) && (issueType.equals("Repo/Rev.Repo")))
{ return issue.get("customfield_12417"); }
else if ((issue.get("customfield_12413").equals("Rev.REPO")) && (issueType.equals("Repo/Rev.Repo")))
{ return ((issue.get("customfield_12417")) + (issue.get("customfield_12422"))); }
else if (issueType.equals("Primary Market Treasury Bills in ALL"))
{ return issue.get("customfield_12450"); }
else if (issueType.equals("Primary Market Treasury Bills in EUR"))
{ return issue.get("customfield_12465"); }
else if (issueType.equals("Treasury Bills in ALL from Banks"))
{ return issue.get("customfield_12481"); }
else if (issueType.equals("Treasury Bills in ALL from Customers"))
{ return issue.get("customfield_12497"); }
else if (issueType.equals("Bonds ALL"))
{ return issue.get("customfield_12518"); }
else if (issueType.equals("Bonds ALL from Banks"))
{ return issue.get("customfield_12351"); }
else if (issueType.equals("EUROBonds from Banks"))
{ return issue.get("customfield_12534"); }
else if (issueType.equals("Open Funds BSH"))
{ return issue.get("customfield_12336"); }
else if (issueType.equals("Fund Transfer"))
{ return issue.get("customfield_12320"); }
else if (issueType.equals("Obligatory Reserve"))
{ return issue.get("customfield_12328"); }
else if (issueType.equals("Cash Deposit BSH"))
{ return issue.get("customfield_13131"); }
-->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using this code, but it is not working
<!-- @@Formula:
String issueType = issue.get("issuetype").getName().toString();
if ((issue.get("customfield_13027").equals("L")) && (issueType.equals("Money Market")))
{ return issue.get("customfield_10010"); }
else if ((issue.get("customfield_13027").equals("B")) && (issueType.equals("Money Market")))
{ return ((issue.get("customfield_10010")) + (issue.get("customfield_10013"))); }
else if (issueType.equals("Forex Spot"))
{ return issue.get("customfield_12371"); }
else if (issueType.equals("Cash against account"))
{ return issue.get("customfield_12406"); }
else if ((issue.get("customfield_12413").equals("REPO")) && (issueType.equals("Repo/Rev.Repo")))
{ return issue.get("customfield_12417"); }
else if ((issue.get("customfield_12413").equals("Rev.REPO")) && (issueType.equals("Repo/Rev.Repo")))
{ return ((issue.get("customfield_12417")) + (issue.get("customfield_12422"))); }
-->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of calculated field is it? Text? Number? Try adding .toString() to each of your return statements. Example: { return issue.get("customfield_10010").toString(); } For debugging, you can add some log.warn(issue.get("customfield_10010")) to see what is returned by this field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Again it not working..... it is working for this condition... else if ((issue.get("customfield_13027").equals("B")) && (issueType.equals("Money Market"))) { return ((issue.get("customfield_10010")) + (issue.get("customfield_10013"))); } but do not work for other confition .... else if ((issue.get("customfield_12413").equals("REPO")) && (issueType.equals("Repo/Rev.Repo"))) { return issue.get("customfield_12417"); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you make sure that REPO is the exact value of customfield_12413? Myabe it has a space after O, like "REPO ". Also, the special characters in Repo/Rev.Repo issue type might need some escaping. Add some log.warn to see the log and go to tickets that should be working for the condition, that way we'll see how the data is saved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{code} <!-- @@Formula: String issueType = issue.get("issuetype").getName().toString(); if (issueType.equals("Task")) { return issue.get("customfield_12600"); } else if (issueType.equals("Story")){ return "this is a story ticket"; } --> {code}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.