Built-In Script runner "to Issue fields" problem in JIRA

Amy Biasella
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.
October 11, 2012

I only have a tiny handle on programming so I'm relying on the built in scripts to generate a custom email since I don't want to mess up our velocity templates.

I want to email all users defined in a custom multi user picker field on a transition. I've tried entering both "customfield_99999" and the custom field name, but no names show up in the "To" field in the preview. The preview works fine otherwise.

An older question looks very similar: https://answers.atlassian.com/questions/45722/how-to-use-a-custom-user-picker-field-in-to-issue-fields-when-sending-a-custom-mail-with-script-runner. I wasn't sure if the given answer is applicable in my case, or if there's something I'm overlooking.

Is it possible to use a multi user picker field here?

8 answers

1 accepted

0 votes
Answer accepted
Amy Biasella
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.
October 15, 2013

(Closing my own old question)

It was indeed a bug from an older version - I think 2.0.6, and we were still on Jira 4.4 at the time. We've since upgraded both and the problem is gone.

Thanks Jamie - I would have been happy to give you the karma for the answer but I suspect you won't miss a few points. :)

0 votes
Kate March 28, 2013

Oh, i'm absolutely happy now! Thank you so much, Jamie :)

0 votes
JamieA
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.
March 27, 2013

That's probably the version with the bug. If you open the jar with winzip or winrar or "jar xf", find the file SendCustomEmail.groovy, line 383 (about) should be:

addresses.add(cf.getValue(issue)?.emailAddress)

line 386:

addresses.addAll(cf.getValue(issue)?.collect{it.emailAddress})

You can make those changes then re-pack the jar (with winzip, winrar or jar).

0 votes
JamieA
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.
March 27, 2013

Or you can upgrade, but the version of the plugin with the fix does not support jira 5.0, hence my instructions above.

0 votes
Kate March 27, 2013

Jira 5.0.6

Script Runner 2.0.7

in my case:)

0 votes
Jamie Echlin March 27, 2013

Which version of script runner are you using? I think there may have been a bug with that type of field in earlier versions.

0 votes
Kate March 27, 2013

hi!

do you have an answer?

0 votes
Eddie Connatser December 10, 2012

I'm having the same issue - I'm trying to pull an email address from a custom field in JIRA, but the "To" field is blank during a preview.

Suggest an answer

Log in or Sign up to answer