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

This widget could not be displayed.

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

Thank you

This widget could not be displayed.

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

This widget could not be displayed.

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 Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Tuesday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

44 views 6 3
Read article

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