Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I query the database to list the users in the specific group.

Mike August 2, 2021

I want to look up users in the database that belong to a certain group i.e. "space-managers"

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2021

If you're using internal accounts, you'll need to join cwd_membership to cwd_user to find a (human) list of people in a group.  And cwd_group to see the human names of the groups.

Mike August 2, 2021

Thanks for answering! Would you be able to write out the SQL? We are using a MySQL instance. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2021

select * from cwd_membership join cwd_user on cwd_membership.child_user_id = cwd_user.id;

Is the raw starting point in postgres (should translate to MySQL without any fuss).  You probably want to add a second join on cwd_group if you want the group names too.

Like Jon Chatwin likes this
Philippe PEREZ
Contributor
November 9, 2022 edited

For faster reference, the MySQL code is: 

SELECT u.*
FROM cwd_user u
JOIN cwd_membership m ON m.child_user_id = u.id
JOIN cwd_group g ON m.parent_id = g.id
WHERE g.group_name = 'GROUP_NAME_TO_CONSIDER'
0 votes
Patrick Vanhoof
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2021

Why do you want to query the database when the information is available in Confluence, see https://community.atlassian.com/t5/Confluence-questions/How-do-I-view-a-list-of-confluence-administrators/qaq-p/1767470?

Philippe PEREZ
Contributor
November 9, 2022

Because you may want to list the users of confluence-users and have 15.000 of them ;-).

Like 3 people like this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence whiteboards, whiteboard templates, template contest, visual collaboration, atlassian learning, confluence community, brainstorming tools, agile planning, team productivity, confluence templates, share your template

Share Your Confluence Whiteboard Template for a Chance to Be Featured in the Product! 🏆

Want to leave your mark on Confluence? One winner will have their whiteboard design added into Confluence for all users to access! This is your chance to showcase your creativity, help others, and gain recognition in the Confluence community.

Share your template today!
AUG Leaders

Atlassian Community Events