List groups with their history size

Last modified by Clément Aubin on 2026/06/02 17:54

cogSimple script allowing to list all the existing groups in XWiki along with their number of direct members and their history size
TypeSnippet
CategoryOther
Developed by

Clément Aubin

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

To execute the script, copy-paste the following snippet :

{{velocity}}
## Get all the groups
#set($groups = $services.query.hql("select doc.fullName, count(distinct obj.id), count(distinct rcs.id) from XWikiDocument doc, BaseObject obj, XWikiRCSNodeInfo rcs where obj.className = 'XWiki.XWikiGroups' and obj.name = doc.fullName and doc.id = rcs.id.docId group by doc.fullName order by count(obj.name) desc").execute())
|=Group|=Members|=History
#foreach($group in $groups)
  ## Get the group document
  |[[$group[0]]]|$group[1]|$group[2]
#end
{{/velocity}}

Get Connected