I am trying to set the value of a custom field based on another field.
Ie:
If custom field Application = Salesforce
Set custom field Additional Assignees = User1
I have a custom script-runner post script function already so I would just try to add to the existing.
So far it auto assigns the ticket if Application = Salesforce but I'd like to add an additional assignee to it.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
//import org.apache.log4j.Level
//import org.apache.log4j.Logger
//def log = Logger.getLogger("com.acme.postfunction")
//log.setLevel(Level.DEBUG)
def applicationCf = customFieldManager.getCustomFieldObjectByName("Application")
def additionalassigneesCf = customFieldManager.getCustomFieldObjectByName("Additional Assignees")
def application = issue.getCustomFieldValue(applicationCf) as String
if (application == "Application1") {
issue.setAssigneeId("Person1")
} else if (application == "Salesforce") {
issue.setAssigneeId("Guy1")