Hi,
I'm trying to set the summary in a WF post-function based on selections of the issue type and a single-user-picker custom field.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.user.ApplicationUser
MutableIssue issue = issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def vIssueType = issue.getIssueType().name
def vUserPickerCF = customFieldManager.getCustomFieldObjectByName("myUserPickerCF")
def vUser = issue.getCustomFieldValue(vUserPickerCF) as ApplicationUser
issue.setSummary("[" + vIssueType + "] " + vUser.displayName + " (" + vUser.username + ")");
The script worked in Jira 7, but while testing Jira 8 the following warnings were raised:
The same appeared for def customFieldManager = ComponentAccessor.getCustomFieldManager()

So I corrected them all and ended up with
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.user.ApplicationUser
MutableIssue mutableIssue = issue
def cfManager= ComponentAccessor.getCustomFieldManager()
def vIssueType = issue.getIssueType().name
def vUserPickerCF = cfManager.getCustomFieldObjectsByName("myUserPickerCF")
def vUser = issue.getCustomFieldValue(vUserPickerCF) as ApplicationUser
issue.setSummary("[" + vIssueType + "] " + vUser.displayName + " (" + vUser.username + ")");
And now this error appears:

I tried to replace "issue." with "mutableIssue." but that doesnt work either, same error.
How should this code look like when upgrading to Jira 8? Is there maybe a simpler way of achieving this?
Thanks & Cheers, Tom