Hello Guys,
For tasks issue types in one of my project I need to assign issues to one particular user, how could I achieve that using scriptrunner ?
I don't want to use workflow post function for procedural reasons in the organization, we need to set assignee as an initializer at the create screen itself, so that its visible to the users as well.
Please suggest if anything,
Tried this but not working.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
UserManager userManager = ComponentAccessor.getUserManager()
ApplicationUser user = userManager.getUserByName("username")
String userKey = user?.getKey()
Issue.setAssigneeId("userKey")