Groovy Clone issue script not working correctly

Currently, when trying to use the "Clone Issue and project" built-in script that comes with Jira out the box, I get the following error:2013-11-05 12:11:24,264 http-bio-8082-exec-18 ERROR ahawkins 731x23568x1 ykvqyg 143.242.72.185 /secure/CommentAssignIssue.jspa [onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-functionjavax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: issueInputParameters for class: Script19at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)at javax.script.AbstractScriptEngine.eval(Unknown Source)at javax.script.ScriptEngine$eval$1.call(Unknown Source)at com.onresolve.jira.groovy.canned.utils.ConditionUtils.doAdditional(ConditionUtils.groovy:104)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88)The piece of Groovy code that I used to was the following in the "additional issue action" field:def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Deliverable'} issueInputParameters.addCustomFieldValue(cf.id, 'Characterization')where the custom field name is Deliverable and the value of that field needs to be set to Characterization.

1 answer

Seems like you are trying to set a custom field value after cloning the issue.

Try using this in the "Additional Code" part of the post function:

def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Deliverable'}

issue.setCustomFieldValue(cf, 'Characterization')

issueInputParameters doesn't always work.

Make sure the value you're setting matches the custom field type

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,304 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot