You can now vote for scripts to help people know if they're useful or not. Login or create an account to vote!


Create a User in Jira


With this script, you can use Scriptrunner to automatically create a user from an email address. This is useful to bulk create users or to trigger the creation of a user after an event occurs.


A user writes an email address in an issue comment, then the email is detected and a user is automatically created with that emails. This reduces administration time and cost.

Good to Know

  • This script includes validation checks to make sure the user hasn't already been created.
  • This script has the ability to collect and log errors for future reference.


  • Jira Jira (8.0 - 8.14)
  • ScriptRunner for Jira ScriptRunner for Jira (6.18.0)
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 = "" // 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.valid : createValidationResult.errorCollection userService.createUser(createValidationResult)
Discovered an issue? Report it here

Suggested for you

Appears in these Collections