I'm searching for a solution that gives me an opportunity to add the user from Custom Field to specific JIRA Group by a post-function workflow or a listener.
I saw solutions like the following example in the community, but this does not seem to work anymore; the addUserToGroup method is not recognized.
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
def user = "Neuling"
def group = groupManager.getGroup("Group1")
groupManager.addUserToGroup(user,group)
Thanks in advance!