Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JIRA Dynamic forms empty value

Darly Senecal-Baptiste
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2013

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

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Darly Senecal-Baptiste
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2013

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

TAGS
AUG Leaders

Atlassian Community Events