Hi, i have a custom scriptrunner listener that adds a subtask when a certain condition is true. I'm trying to add a label of "Testing" to this subtask in the 'Additional issue actions' part of the listener. The code i've been trying to use is:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.label.LabelManager
ApplicationUser user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
LabelManager labelManager = ComponentAccessor.getComponent(LabelManager.class)
labelManager.addLabel(user, issue.id, 'Testing', false)
I'm receiving the following error:
The script could not be compiled:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script51.groovy: 4: unable to resolve class ApplicationUser
@ line 4, column 17.
ApplicationUser user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
^
1 error