Is their any way to add all 100 users in a below script, so that all users created in one go OR i need to run script everytime for each users.Please suggest
import com.atlassian.jira.bc.user.UserService
import com.atlassian.jira.component.ComponentAccessor
// the username of the new user - needs to be lowercase and unique - required
final String userName = "user"
// The password for the new user - if empty a random password will be generated
final String password = "password"
// The email address for the new user - required
final String emailAddress = "user@jira.com"
// The display name for the new user - required
final String displayName = "New User"
// notifications are sent by default, set to false to not send a notification
final boolean sendNotification = false
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def userService = ComponentAccessor.getComponent(UserService)
def newCreateRequest = UserService.CreateUserRequest.withUserDetails(loggedInUser, userName, password, emailAddress, displayName)
.sendNotification(sendNotification)
def createValidationResult = userService.validateCreateUser(newCreateRequest)
assert createValidationResult.isValid() : createValidationResult.errorCollection
userService.createUser(createValidationResult)
Source :- https://library.adaptavist.com/entity/create-a-user-in-jira
@Stephen_Wright @Nic_Brough__Adaptavist_ @Kristian Walker (Adaptavist) @Adrian_Stephen @Derek_Fields @Ravi_Sagar__Adaptavist_
Please help
Thanks
Vikrant yadav