Hi,
I want to use Fast-track transition and change the assignee at the same time.
My script automatically changes the assignee and also changes the status when I select a custom field value.
However, when I set the value of the "custom field" to 'None' and select the assignee, the "Assignee field" value changes to 'unassigned'.
if i set the value of the "custom field" to 'None' and select the assignee, "Additional issue actions" does not work.
[Condition]
cfValues['Designated Person']?.value != 'None' || issue.assignee != 'Unassigned'
[Action] : Assigned (next status)
[Additional issue actions]
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
def issueManager = ComponentAccessor.issueManager
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userName = ""
// Here you'll replace for your custom cascade field name
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Designated Person")
log.warn("customField: " + customField)
def customFieldValue = issue.getCustomFieldValue(customField)
log.warn("customFieldValue: " + customFieldValue)
switch (customFieldValue){
case "[RND] SF":
userName = "haimai"
break
case "[RND] HanPrism":
userName = "Hoang"
break
case "[RND] HanPHI":
userName = "Sunil"
break
case "[RND] CPS, HanTops, ECOMS, BTMS":
userName = "hjyun"
break
case "[E&S] IPS, V&V":
userName = "jskim"
break
case "[E&S] Solution":
userName = "ejjoo"
break
case "[CS] Nuclear Maintenance Service":
userName = "buggi79"
break
case "Sales":
userName = "st"
break;
case "Financial Management":
userName = "fm"
break
case "General Management":
userName = "gm"
break
}
issue.setAssignee(ComponentAccessor.getUserManager().getUserByName(userName))
// Here the issue will be updated
issueManager.updateIssue(currentUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)