Get user info - $services.user.getProperties

I have code (xwiki 12.2):


and get


How to get email or first_name from there?

I want to use it for users from group:
$allGroupsInAllWikis = $'xwiki:XWiki.XWikiAdminGroup')

And I get array
$allGroupsInAllWikis = [xwiki:XWiki.Pablo, xwiki:XWiki.Martinez]
, so in loop I would get email for each user.

Hi, the doc is at (I’ve added a link to the UserProperties sources). Note that javadoc is available at

Which leads to!/index.html which leads to!/org/xwiki/user/UserProperties.html

For example:


So I use


and for both get the same email address (email of logged in user) :confused:

when I use fake user I get still the same email


Now I workaround it with:

#set($allGroupsInAllWikis = $'xwiki:XWiki.XWikiAdminGroup'))

#foreach($prop in $allGroupsInAllWikis)
  #set($userDoc = $xwiki.getDocument($prop))


Thanks, you’ve found a bug in the new user api! Could you report a bug on

Note, the issue is a velocity method signature mapping (the wrong method signature is used), and thus you get the properties for the current logged-in user.


So thats mean that this need new version of xwiki to fix or juzt extension update? :slight_smile:


New version of XWiki (although you could patch your version too). But two things:

  • There’s a workaround, see my comment on the jira issue
  • You can use the older user api which works fine (even though not recommended for the future):

Thanks, I’ll fix it tomorrow morning.