Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

show group member and hide admins

Kevin Ebel October 8, 2015

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

0 votes
Answer accepted
Kevin Ebel October 29, 2015

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

Thank you

1 vote
Kevin Ebel October 8, 2015

Hello Eduardo,

that might be a good solution.

Thank you for the help smile

 

Greetings Kevin

Mallmann
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2015

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!

Kevin Ebel October 12, 2015

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.

1 vote
Mallmann
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events