/** * A script that listens to new UserCreatedEvents and adds the new user to the jira-users group. */importcom.atlassian.jira.component.ComponentAccessorfinaldefJIRA_GROUP="jira-users"defnewUserName=event.user.nameasStringdefuser=ComponentAccessor.getUserManager().getUserByName(newUserName)defgroupManager=ComponentAccessor.getGroupManager()ComponentAccessor.getGroupManager().addUserToGroup(user,groupManager.getGroup(JIRA_GROUP))log.debug"Newuserwithname:${user.displayName}andkey:${user.key}addedtogroup:${JIRA_GROUP}
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.