On issue creation I want to automatically assign the reporter with a specific person (i.e. not the person creating the issue), i,m trying to use script runner post function in create transition of workflow. I had a script that add particular user as watcher can any one modified the script to particular user assign to reporter.
Here the script below
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.MutableIssue
def userName = "user name"
def userManager = ComponentAccessor.getUserManager()
MutableIssue issue = issue as MutableIssue
def user = userManager.getUserByName(userName)
def watcherManager = ComponentAccessor.getWatcherManager()
watcherManager.startWatching(user, issue)
Thanks in advance
Siva