I want to use Script Runner to copy current Assignee to a custom text field 'Resolved by' using the post function during the last transition, which is resolving the issue. I simply want to be able to report on who resolved the issue.
For some reason this script I have developed doesn't work. I will appreciate any help to get this right.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def userCf = customFieldManager.getCustomFieldObjectByName("Resolved by")
def assignee = issue.getAssignee()
issue.setCustomFieldValue(userCf, assignee)