Hi All,
I have a script in place which should change the reporter after the creation phase (post-function). The source of the new reporter is a single-user-picker. The idea is, as soon as somebody creates a ticket for someone else I want that the "someone else" will be set as the new reporter. I am using JIRA 7.8.0 with JIRA SD 3.11 and cant find my mistake.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
MutableIssue issue = issue
def onBehalfOfCustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("ASD: On behalf of")
def onBehalfOfValue = issue.getCustomFieldValue(onBehalfOfCustomField)
if (onBehalfOfValue){
issue.setReporter(onBehalfOfValue)
}
Best,
Kristian