Hi!
I'm using JIRA 6.3.5
I'm trying to use formula, that will give me something like this:
if issue.get("customfield_10303") = 1
return "one"
if issue.get("customfield_10303") = 2
return "two"
I tryed lot of formulas, but they does not works!(( Please help me...
P.S. customfield_10303 is a "number only" field
Hello,
to compare two values you need to use == instead of =
<!-- @@Formula: Integer i = issue.get("customfield_10303").intValue ();
if (i==null) return null;
if (i==1) return "one";
if (i==2) return "two";
-->
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.
what data type is issue.get("customfiled_10303)? I bet is String.
Try adding quotes around "1" and "2".
Mike Hester BlackpearlPdm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
data type? Just custom number field. quotes not working. <!-- @@Formula: if issue.get("customfield_10303").intValue = "1" return "one" -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<!-- @@Formula: if (issue.get("customfield_10303").intValue()) = "1" return "one" --> not working either <!-- @@Formula: (issue.get("customfield_10303").intValue()) --> works good, but i need "if" cascade
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.