I made a custom field whose value am polpulating from a csv file which I have uploaded from jira console. I configured that field on jira screen and able to see the options there. Now I am trying to get the checked values in my groovy script & using the below code for that:
ComponentManager componentManager = ComponentManager.getInstance();
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
CustomField svnPathcustomField = customFieldManager.getCustomFieldObject("customfield_12681");
log.error("svnPathcustomField -->"+svnPathcustomField);
String[] svnPath = (String[]) issue.getCustomFieldValue(svnPathcustomField);
log.error("svnPath -->"+svnPath);
In logs the value of "svnPath" is coming null... Please help.
Thanks.
> The script failed : javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: o for class: Script24
What's this...? Where is "o" in your code? Can you paste the full script somewhere.
Are you sure the field has options selected?
Tried this but again got the value as "null".. :( below is the error on console -
2013-02-13 10:09:28,757 ajp-bio-8009-exec-110 ERROR 502005038 609x16122x1 z4rdb 3.209.125.241 /secure/CommentAssignIssue.jspa [onresolve.jira.groovy.GroovyRunner] svnPath: null
2013-02-13 10:09:28,781 ajp-bio-8009-exec-110 ERROR 502005038 609x16122x1 z4rdb 3.209.125.241 /secure/CommentAssignIssue.jspa [onresolve.jira.groovy.GroovyRunner] The script failed : javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: o for class: Script24
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 field is it?
Does the issue definitely have a value for that field?
What context is the script running in, eg post-function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be getting an error not null - you can't cast a collection of Option objects to a String[] - I think. Remove the cast and static typing and just log the return value:
def svnPath = issue.getCustomFieldValue(svnPathcustomField)
log.warn "svnPath: $svnPath"
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.