I'm trying to figure out how to get a user when I only have the userkey, which I hope someone can help me with.
When mentioning someone on the page I can only get the userkey, and I need to figure out if some mentioned users are deactivated. I see that I have getUserByKey in the User Accessor, but that function needs a UserKey (
import com.atlassian.confluence.user.UserAccessor
import com.atlassian.sal.api.component.ComponentLocator
UserAccessor userAccessor = ComponentLocator.getComponent(UserAccessor)
userAccessor.getUserByKey(new UserKey(userKey))
Hi Brian, your question seems to be unclear. You are saying all you have is the userKey but then follow that by saying you cannot find out how to get the userKey. Please clarify.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes maybe I'm not clear.
But as I was waiting I found out, that I just had to create a new UserKey object to use the String to obtain the actual UserKey.
UserKey userKey = new UserKey(<userkey as string>)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.