Hi,
I have problem with setting new email to user in Confluence by groovy.
Documentation says that class com.atlassian.user.User have method setEmail(String email), but Script Console in Confluence says the opposite - Confluence uses implementation class com.atlassian.confluence.user.ConfluenceUserImpl and this class has no method for set email.
This is my code:
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.user.UserManager
import com.atlassian.user.User
def userManager = ComponentLocator.getComponent(UserManager)
User user = userManager.getUser("user001");
user.setEmail("new@email.cz");
Have you idea how can I set the new email by groovy (script runner) in Confluence?
Thanks
Lukas
maybe you should try this to get user
def users = userManager.users.find{it.getName() ==
"username"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.