Using ${cfValues['myCustomFieldName'].email} in the template works fine, but neither of these work as 'To issue fields' to determine the mail recipient:
cfValues['myCustomFieldName'].email
cfValues['myCustomFieldName']
${cfValues['myCustomFieldName'].email}
${cfValues['myCustomFieldName']}
So, what am I doing wrong? Or do I have to copy the mailadress to a scripted field an read it from there (if so, how do I do that)?
Thanks for any help
Thomas
edit:
Using ${cfValues['myCustomFieldName'].email} in the template works fine!
In the to section, you should just enter the ID of the custom field, eg customfield_9999. If it's the right type, for instance a User custom field, then it will be handled.
Your code is correct for the template, but that's processed different. The to list is just a list of fields, rather than a groovy program that is processed.
Thanks,
that works for the usual user picker fields - sadly it does not work for the 'Last Resolution User' from the Jira Enhancer plugin. Any idea how to get that working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would need to extend UserCFType, or I'd need to cater for it specifically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
How would you specify a 'scripted field' (of type string) in the 'to issue field'
It currently returns
2013-08-20 21:53:48,062 http-8080-6 WARN admin 1313x477x1 1inm9te 127.0.0.1 /secure/CommentAssignIssue.jspa [canned.workflow.postfunctions.SendCustomEmail] Unhandled custom field type customfield_11901
If this is not supported, would there be a workaround ?
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Francis,
The version released about 10 minutes ago (2.1.11) is less fussy about the field types. So long as .toString() on the field value looks like an email address, or a comma-delimited list of email addresses, it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What a great amazing unexpected turnaround
My only problem is that this instance is JIRA 5.0.7. :-/
Can I backport your change to groovyrunner 2.0.7 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And the answer is yes.
Just follow the 'Built-In Scripts Hacking Notes'
https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Built-InScriptsHackingNotes
(copy the sendCustomEmail.groovy out of groovyrunner-2.1.11.jar)
Thanks J, much obliged.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
;-) no problem. That particular thing of sending mail to a recip provided by a scripted field has not been tested that much, LMK if you have any problems.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works perfect on scriptrunner 2.0.7 and JIRA 5.0.7
We have now a scripted field which retrieves the email address of the contact person out of the CRM, and a script listener sending email when an issue is resolved or requires feedback. It took about a couple of hours to get it up and running (and tested)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamie Echlin [Adaptavist], in To field is possible to use a Scripted field with template user picker? I've tried but it seems that this is not working. Thank you in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a custom field: "Account Name" defined as a select list. It's be data filled with 20 or so name of various companies. I'm using the bulidin script to send a custom email and in the template I specified
Account Name: $cfValues['Account Name']
But the email contains:
Account Name: [Account Name:AT&T Wireless Group, Contact Name:Bob Smith, Customer:null, Customer Severity:P1 - Network is down and business is impacted, Fixed in Revision:null, Found in Revision:null, Gating:null, MKSid:null, MKSid_URL:null, Modifications:null, PV Prime:null, Planned For:null, Platform:[ALL], Ref #:null, Reviewer:null, Testcases:null, Verified in Load:null]['Account Name']
I want it to say
Account Name: AT&T Wireless Group
So what am I missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Brent, this should be a new question. Select lists have Option values, to get the string value you want:
Account Name: $cfValues['Account Name']?.value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.