Hey guys, i am trying to evaluate whether a field "customer request type" is two values out of a possible 10. This is for sending an email using the JVME plugin under conditional execution.
On another site, the groovy OR command seems to be two pipes ( || ) but that does not seem to work:
return (issue.get("Customer Request Type").getName() == "General Cleaning" || "Event Cleaning")
That statement always returns TRUE, no matter the issue. Still returns true even if i put "fdsfdsf" instead of "general cleaning".
However the following does work correctly:
return (issue.get("Customer Request Type").getName() == "General Cleaning")
What is the correct way to evaluate the field and then return true if it meets "value 1" OR "value 2" but nothing else.
I looked through the groovy tutorial, but i am not a programmer... under logical operators it does appear that || is an or, but well i need help at this point.
I think you'll want something like this:
return (issue.get("Customer Request Type").getName() == "General Cleaning" || issue.get("Customer Request Type").getName() == "Event Cleaning")
When you just had the "|| "Event Cleaning", your condition was trying to resolve a string as a boolean value, which I believe just returns true because the string exists.
works perfect thank you.
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.