Hi all, I'm using the Scriptrunner post function and i'm trying to set the assignee based on a component and custom field. I understand apart from setting the assignee, you'd also need to store that in the DB. (Currently it doesn't change the value of the assignee). Could anyone help with how to store the assignee? Below is what i have so far
import com.atlassian.jira.component.ComponentAccessor
// the username of the assignee
final String user= "user1"
def user_user1 = ComponentAccessor.userManager.getUserByName(user)
def location = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("Location")
def location_val = issue.getCustomFieldValue(location)
if(issue.components*.name.contains('Hardware') && location_val == "Utrecht" ){
issue.setAssignee(user_user1)
}