Hello,
I'm able to create a confluence user in groovy with the following script :
{code}
Hi @Malesys Elie
Please check this post which might give a hint.
Original user never replied, but this seems to be the answer
Here's how I create a user in Confluence Data Center 8.5.3, and add the user into a group.
Sorry, this didn't answer the question. But I record it here, since when I google how to create a user in Confluence using groovy, this post always comes on the first page. So I'd like to record the codes here, hope it could help someone.
import com.atlassian.sal.api.component.ComponentLocatorimport com.atlassian.confluence.user.UserAccessorimport com.atlassian.confluence.user.ConfluenceUserImplimport com.atlassian.user.security.password.Credentialimport com.atlassian.user.GroupManagerdef userAccessor = ComponentLocator.getComponent(UserAccessor)def groupManager = ComponentLocator.getComponent(GroupManager)def user = new ConfluenceUserImpl("foo", "foo", "foo@email.local")userAccessor.createUser(user, Credential.unencrypted('your password here'))def group = groupManager.getGroup("some-group")userAccessor.addMembership(group, user)
It looks like you're new here. Sign in or register to get started.