Hello all,
I am attempting to create a custom email post function using the Send a custom email (ScriptRunner). One of our main requirements for this is that it sends to the blind carbon copy (Bcc). I've referenced two different scripts both with no success either individually or combined. The emails will be fail in the mail queue.
See Linked
https://community.atlassian.com/t5/Jira-questions/Add-Bcc-to-custom-email-via-post-function/qaq-p/626373
https://docs.adaptavist.com/sr4js/latest/features/workflows/post-functions/built-in-post-functions/send-a-custom-email
Condition and Configuration
import com.atlassian.jira.component.ComponentAccessor
//set recipients from request participants
def multiSelectAddressesCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Request participants")
def recipients = issue.getCustomFieldValue(multiSelectAddressesCF)?.join(",")
mail.setBcc(recipients )
I have been able to test this with the "mail.setTo(recipients )" with success. Also inputting the direct email into "mail.setBcc("me@example.com" )" will not send to the Bcc but it will send to the "TO" recipient.
Any and all help is appreciated.
Jira Version: 8.20.12
Scriptrunner Version: 7.8.0