Hi Everyone,
we create users by a jelly script (soon by groovy) and in these cases we create bulk of them. It happens many times that we already have a user in our database and we create it once again. Is there a code snippet which checks whether an email address already registered in our DB and if yes, the user will not be created or JIRA warns us?
Thanks!
Really? JIRA allows you to re-use a username?
In Groovy you can simply use getUserByEmail
method.
import com.atlassian.crowd.embedded.api.User; import com.atlassian.jira.user.UserUtils; String emailAddress='my@address.com'; User user = UserUtils.getUserByEmail(emailAddress); if (user==null){ //create users here }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.