I have just updated ScriptRunner.
In Send Custom Email, I was using a custom field (script field) in the "To Issue Fields" field.
However, after updating, it cleared the value of this field so my emails have no to addresses. When I go now to enter the custom field again it gives a dropdown of available custom fields, but the script fields are not listed?
In your Condition and Configuration section add
import com.atlassian.jira.component.ComponentAccessor def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Scripted Field") if (!cf) log.debug "Scripted field does not exist" def recipients = issue.getCustomFieldValue(cf) as String mail.setTo(recipients)
In order to preview you have to select the Disable validation checkbox because you are setting from/to/cc etc dynamically.
PS. Where variable mail is type of Email
Let me know if this does the trick
Cool, anytime Keith.
I will investigate how "easy" will be to add the scripted fields in the dropdown with the available To Issue fields. But the main reason behind not to include is that with a scripted field we are not sure what kind of value/s will have.
Therefore we also updated the Configuration section in order to increase it's flexibility and make it easier to do more complicating things via scripting.
Hope that in overall you find the changes better.
The fields that are available to select from are those that are quite possible to hold valid email addresses or users (and therefore possible to get their email), aka the fields that their type is instance of UserCFType, MultiUserCFType, MultiGroupCFType or TextFields.The scripted field is not in the available fields.
But you can add recipients from the Condition and Configuration section using
If you want to tell me what type of template you use for your scripted field I can assist further.
Thank you. I am using Send Custom Email in the workflow Post Functions. I am doing all the formatting (template) in the Email Template section.
I tried to set the email address in the 'Condition and Configuration' section using something like the example you gave ( mail.setTo("firstname.lastname@example.org") ) but it still gives "You must provide either fields or addresses to send emails to."
I have a custom field (script field - below) that stores a comma separated list of email recipients - which was working 100% with previous versions. If I can somehow still use the email addresses in this field and use mail.setTo, that would be good?
In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to have–in order to produce a reliable long-term roadmap. We're tur...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG