You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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
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
I was finally able to get it going with the following script in the condition and configuration. I also needed to clear the cache in order to get it going.
import com.atlassian.jira.component.ComponentAccessor
//set recipients from request participants
def multiSelectAddressesCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Bcc..")
def recipients = issue.getCustomFieldValue(multiSelectAddressesCF)?.collect {
it.emailAddress
}?.join(",")
//BCC Email List
mail.setBcc(recipients)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.