Hello,
i cant manage to suppress the "Account created" mail that is sent when i execute this code:
import com.atlassian.jira.bc.user.UserService;
import com.atlassian.jira.component.ComponentAccessor;
UserService userService = ComponentAccessor.getComponent(UserService.class);
UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest
.withUserDetails("admin", "newusername", "", "email@email.com", "Firstname Lastname")
.withNoApplicationAccess();
createUserRequest.sendNotification(false);
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest);
Thanks in advance, Internet <3
ok i got it (sendNotification returns a CreateUserRequest):
UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest
.withUserDetails(runAsJuser, username, "", mailAdressString, issue.getSummary())
.withNoApplicationAccess()
.sendNotification(false)
;
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest);
Hi Jens,
Use the sendNotification method
Specify whether a notification should be sent when the new user has successfully been created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Edwin,
thanks for your reply.
I tried it like this but a mail was sent out:
UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest
.withUserDetails(runAsJuser, username, "", mailAdressString, issue.getSummary())
.withNoApplicationAccess()
;
createUserRequest.sendNotification(false);
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest);
Any Idea whats going on?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok i got it (see below)
Thanks!
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.