show group member and hide admins

Hello,

 

is there a way to get List of the Users which are members of a group and hide the admins in this group?

 

Thank you all for the help

3 answers

1 accepted

Please close the Ticket, because we don't search for a solution any more.

Thank you

1 vote

Hello Kevin,

It's possible to retrieve the members of a group through API or querying the database, so it depends on what you're looking for. However, to hide the admins you might need to use SQL and exclude the admins.

For example, to retrieve users from confluence-users group you run a query like this:

SELECT d.directory_name,
       g.group_name,
       u.user_name
FROM cwd_membership cm
INNER JOIN cwd_group g ON cm.parent_id = g.id
INNER JOIN cwd_user u ON cm.child_user_id = u.id
INNER JOIN cwd_directory d ON g.directory_id = d.id
WHERE cm.parent_id IN
    (SELECT id
     FROM cwd_group
     WHERE group_name LIKE 'confluence-users');

This retrieves all users from confluence-users group. Then, you can remove from this query, those users that are member of confluence-administrators:

SELECT d.directory_name,
       g.group_name,
       u.user_name
FROM cwd_membership cm
INNER JOIN cwd_group g ON cm.parent_id = g.id
INNER JOIN cwd_user u ON cm.child_user_id = u.id
INNER JOIN cwd_directory d ON g.directory_id = d.id
WHERE cm.parent_id IN
    (SELECT id
     FROM cwd_group
     WHERE group_name LIKE 'confluence-users')
  AND cm.parent_id NOT IN
    (SELECT id
     FROM cwd_group
     WHERE group_name LIKE 'confluence-administrators')
  AND cm.child_user_id NOT IN
    (SELECT child_user_id
     FROM cwd_membership
     WHERE parent_id IN
         (SELECT id
          FROM cwd_group
          WHERE group_name LIKE 'confluence-administrators'));

You might be able to achieve it using macros too.

 

I hope it helps! smile

Eduardo

Hello Eduardo,

that might be a good solution.

Thank you for the help smile

 

Greetings Kevin

Hey Kevin, if that answer helped I'd suggest you to accept the answer so we can close this topic, although other users will still be able to share other solutions. Cheers!

I've tried it last weekend and the problem is, its working but its to complexe for the monitoring. The Best way would be a confluence plugin to including the stuff in the Documents.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

284 views 11 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you