I would like to get a count of the total members for a user group. I see plenty of ways to get the global user count in the Confluence API, but nothing similar to Jira’s GroupManager#getUsersInGroupCount(com.atlassian.crowd.embedded.api.Group group).
I am wary of getting the entire member set due to the potential for a very large group resulting in a big memory hit. Raw SQL is an obvious conclusion but a minefield in terms of syntax and maintenance. Any thoughts?
Thanks for your input. I had considered this approach but this seems quite memory-intensive considering that I only need the total count. Something in the API which does a COUNT SQL query under the hood sounds better to me…
The underlying problem is, that group memberships are not only stored in one Confluence database table (e.g. if you have an eternal user directory like LDAP or Crowd). So one SQL-query (if you find one) might not return all group members or has to be dependent on the user directory.