Hello,
The intenso Dynamic Forms works fine in terms of visibility and usability of the field in screen. Also, I want also to use the value of the Dynamic Form (in this case, the dynamic select) to copy on another field by using groovy. When ran a groovy script in order to review the selected value of the Dynamic Select field, the log tells me that the value is null. Here is my code
def cflist = customFieldManager.getCustomFieldObjects(issue) as List<CustomField> log.warn("Issue Dump ---> ${cflist.dump()}"); // List of all fields in the issue def cfDisc = cflist.find {it.getName().equalsIgnoreCase("District")} //Dynamic Select Field def cfDiscV = cfDisc.getValueFromIssue(issue) //Value of the dynamic select field log.warn("District ID: ${cfDiscV.dump()} \n");
An here is the log file result
2013-05-03 09:41:16,673 http-bio-8080-exec-8 ERROR admin 581x1101x1 1wxsi92 172.16.0.41 /secure/QuickCreateIssue.jspa [onresolve.jira.groovy.GroovyRunner] The script failed : javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method hashCode() on null object 2013-05-03 09:41:16,673 http-bio-8080-exec-8 ERROR admin 581x1101x1 1wxsi92 172.16.0.41 /secure/QuickCreateIssue.jspa [onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-function javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method hashCode() on null object at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:103) at javax.script.AbstractScriptEngine.eval(Unknown Source) at com.onresolve.jira.groovy.GroovyRunner.runFile(GroovyRunner.java:97)
Hope that there is an answer.
Thanks a lot
Community moderators have prevented the ability to post new answers.
I found it
The error came from
def cfDiscV = cfDisc.getValueFromIssue(issue)
Which "does not recognize the value inside of the field"
Instead, I did the following:
def cfDiscV = issue.getCustomFieldValue(cfDisc)
Thanks to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.