groovy script to send email failing in 5.2.2

This groovy script(Script Runner 2.1.3) running in a workflow transition as a post-functions worked in Jira 4.3.6 to (1) cloned an issue from one project to another and then (2) sends out email to particular managers depending on the severity of the issue. Now that we have upgraded to 5.2.2, the cloning works but I see no emails. In the catalina.out, I see the following traceback:

2013-05-16 20:45:25,142 http-bio-8080-exec-14 ERROR ebreweb 1245x2552x1 1x4bvu2, /secure/QuickCreateIssue.jspa [onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-function
groovy.lang.MissingPropertyException: No such property: fullName for class: com.atlassian.jira.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 org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetPropertySafe(
        at groovy.tmp.templates.GStringTemplateScript4$_getTemplate_closure1.doCall(GStringTemplateScript4.groovy:19)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

I'm using the standard script runner template to create the email. The condition is
cfValues['Customer Severity']?.value == 'P1 - Network is down and business is impacted'

and the email template is

** URGENT **: P1 Customer Severity raised

Summary: ${issue.summary}

Account Name: <% out << cfValues['Account Name']?.value %>

Contact: <% out << cfValues['Contact Name']?.value %>

Severity: <% out << cfValues['Customer Severity']?.value %>

Issue Number: $issue.key

Description: ${issue.description}

Raised by: <% out << issue.reporter?.fullName %>$issue.key

Is there any conversion of the scripting templates that I missed?

3 answers

1 accepted

This widget could not be displayed.
Henning Tietgens Community Champion May 16, 2013

You have to use issue.reporter?.displayName for your JIRA version.

This widget could not be displayed.

Thanks Henning, that did the trick. Where can I find documentation on these changes. Groovy scripting is a black art ;-) but it does the trick.

This widget could not be displayed.
Henning Tietgens Community Champion May 16, 2013

You can use the official API documentation, here is a nice starting point: Atlassian API Reference

And you could take a look at the wonderful built-in scripts from Jamies Script Runner plugin to learn, how things work.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

54 views 1 0
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