Unable to create new user in specific directory by default user is creation in the top most directory and I am running this code in script runner console
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userService = ComponentAccessor.getComponent(UserService)
UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest.
withUserDetails(user, "xyz", "password", "firstname.lastname@example.org", "xyzz")
createUserRequest.inDirectory(1234567) //I have mentioned the directory id from crowd //details ex: Directory 3: Directory ID: 1234567
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest)
Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events