I am working on creating users more quickly, hoping someone could assist with helping me add the ability to create user and add to a specific group.
The creation script seems to be working (JIRA Server 8.5.x):
import com.atlassian.jira.bc.user.UserService
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userService = ComponentAccessor.getComponent(UserService)
UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest.
withUserDetails(user, "USERNAME", "ThisThis", "EMAIL ADDRESS", "First Last")
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest)
if(result.isValid())
userService.createUser(result)
else
result.getErrorCollection()
I am trying to add where the created user with be added to a specified group. So far I have been running into issues where the variable is already in use. Any assistance is appertained. Thanks!