Hey, so let's assume I don't really know how to write Groovy. But I looked at some sample scripts, and in trying to set a couple of User Picker fields (multiple users) based on what is in a Select field (Major or Minor), I naively tried this:
def severity = issue.get("customfield_10551").getValue()
if (severity == "Major") {
return 'dlprodalert'
} else {
return 'prodalertminor'
}
And I got slapped with this error:
2014-05-23 16:47:15,054 http-bio-8080-exec-193 WARN darryll 1007x6062x1 fk8wyq 69.53.237.72,10.200.150.205 /secure/QuickCreateIssue.jspa [jmwe.plugins.functions.SetFieldValueFunction] Error while executing SetFieldValueFunction: groovy.lang.MissingMethodException: No signature of method: java.lang.String.getValue() is applicable for argument types: () values: []
Possible solutions: getClass(), getAt(groovy.lang.IntRange), getAt(java.util.Collection), getAt(java.util.Collection), getAt(groovy.lang.Range), getAt(groovy.lang.Range)
groovy.lang.MissingMethodException: No signature of method: java.lang.String.getValue() is applicable for argument types: () values: []
Possible solutions: getClass(), getAt(groovy.lang.IntRange), getAt(java.util.Collection), getAt(java.util.Collection), getAt(groovy.lang.Range), getAt(groovy.lang.Range)
This (and the many other questions in this forum) could probably be avoided if the documentation offered a few examples of writing Groovy expressions.
Thanks!