Can not sent email directed to a custom field of type "mulitple user" select

Hello, i have a custom field that allow me to pickup multiple users. When askin to script send en email to this custom field, i get the error bottom. It seems embedded groovy script is using at line 377 instead of it.emailAddress.

I have tried copy / pasting the groovy code in a new groovy file and create a post function the use this new script, but then i loose all configuration capabilities of embeded scripts :/

Am i doing something wrong / is there an easy workaround?

PS: can't find bug tracker of groovy runner, so sorry if it's a know issue.

groovy.lang.MissingPropertyException: No such property: email for class: com.atlassian.crowd.embedded.ofbiz.OfBizUser
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(
	at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail$_getAddressesFromFields_closure7.doCall(SendCustomEmail.groovy:377)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.codehaus.groovy.reflection.CachedMethod.invoke(
	at groovy.lang.MetaMethod.doMethodInvoke(
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(
	at groovy.lang.MetaClassImpl.invokeMethod(
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(
	at org.codehaus.groovy.runtime.dgm$78.invoke(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail.getAddressesFromFields(SendCustomEmail.groovy:377)
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail$getAddressesFromFields.callCurrent(Unknown Source)
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail.getAllAddresses(SendCustomEmail.groovy:338)
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail$getAllAddresses.callCurrent(Unknown Source)
	at com.onresolve.jira.groovy.canned.workflow.postfunctions.SendCustomEmail.getDescription(SendCustomEmail.groovy:450)
	at com.onresolve.jira.groovy.canned.CannedScript$ Source)

1 answer

0 votes

An easy option would be to create an event, add the multi user field into the event and throw the event using the script.

unfortunately, we want to use 'send email' post function script because it let us customize the templates. The purpose is to send some very specific informational emails to some users, but those used shouldn't / don't need to know jira is behind this :) (It's basically an email stating "those Xyz informations are needed to solve your problem, please contact operator at number abc" )

I have worked around the problem using documentation section "built-in scripts hacking notes". And it confirms that changing from to it.emailAddress is the solution to the problem :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


249 views 0 6
Read article

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