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"
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.