Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How do I see the number of users in a group?

Hello, I want to clean up my groups in Confluence. How do I see the number of users in the groups without having to select them one by one? Thanks

3 answers

1 accepted

0 votes
Answer accepted

I am not aware of any way to obtain this info from the front end. However, you can query the database directly e.g for users in crowd directory --select /count (*) /distinct from CWD\_MEMBERSHIP where GROUP_NAME= <> and check the groups from CWD\_GROUP would be a nice place to start.

If using Atlassian Crowd as the backend auth server, you can find the number of users in a group with the following Crowd REST API call:

curl -s -n \
-H "Accept: application/json" \
'https://mycrowd.server/crowd/rest/usermanagement/1/group/user/direct?groupname=my-test-group&max-results=10000' | jq -r '.users[].name' | wc -l

If the result comes out at exactly the same as max-results, increase max-results until it doesn't.

An alternative method is to use the Confluence REST API with jq, for example:

curl -s -n \
-H "Accept: application/json" \
'https://myconfluence.server/rest/api/group/nexus-users/member'| jq -r .size


However... there is a limit of 200 results by default, so for groups with more than 200 users, you will need something a little more elaborate that uses the pagination feature.

Here's a shell script I knocked together that copes with groups containing any number of users:

#!/usr/bin/env bash

result=$(curl -s -n \
-H "Accept: application/json" \
size=$(echo $result | jq -r '.size')
next_set=$(echo $result | jq -r
base=$(echo $result | jq -r ._links.base)

while [[ $next_set != "null" ]]
result=$(curl -s -n -H "Accept: application/json" "${base}${next_set}")
size=$(echo $result | jq -r '.size')
echo running total: $total # this is optional
next_set=$(echo $result | jq -r

echo Total members in $groupname is: $total

which when called, looks something like this:

➜ ./ my-test-group
running total: 400
running total: 600
running total: 800
running total: 1000
Total members in my-test-group is: 1008


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

974 views 15 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you