I have the code below in my configuration section of my post function.
The mail.setFrom and mail.setFromName both work but the mail.setBcc doesn't.
Its worked with a string directly into this function but doesn't like when I pass a variable
mail.setFrom("email@domain")
mail.setFromName("ABC Mailbox")
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.component.ComponentAccessor;
def customFieldManager = ComponentAccessor.getComponent(CustomFieldManager)
def RECIPIENTSCF = customFieldManager.getCustomFieldObjectByName("Recipients")
def String RECIPIENTSBCC = RECIPIENTSCF.toString()
mail.setBcc(RECIPIENTSBCC)
return true