Dear all,
I could not find out the proper to do it hpe anyone can point out to correct querry.
I have a need to list all users from confluence-users goup which belongs also to an other group A
Any idea of the correct SQL querry ?
regards
Hi @serge calderara Welcome to the community!To achieve this, you can use a query that joins the relevant tables in your Confluence database. Assuming you have tables named user_group and group_membership, here is an example of how you might structure your query.
user_group
group_membership
SELECT u.username FROM user_group ug1 JOIN group_membership gm1 ON ug1.user_id = gm1.user_id JOIN user_group ug2 ON gm1.user_id = ug2.user_id WHERE ug1.group_name = 'confluence-users' AND ug2.group_name = 'Group A';
Regards,Sushant Verma
Hi @serge calderara ,
We use the below query in oracle DB to get the data.
SELECT cu.DISPLAY_NAME, cu.USER_NAME, cu.EMAIL_ADDRESS, g.group_nameFROM cwd_user cuJOIN cwd_membership m ON cu.id = child_user_idJOIN cwd_group g ON m.parent_id = g.idJOIN cwd_directory d on cu.directory_id = d.idWHERE g.group_name = 'confluence-users'
if you want to get the active users you can use the below one
SELECT cu.DISPLAY_NAME, cu.USER_NAME, cu.EMAIL_ADDRESS, g.group_nameFROM cwd_user cuJOIN cwd_membership m ON cu.id = child_user_idJOIN cwd_group g ON m.parent_id = g.idJOIN cwd_directory d on cu.directory_id = d.idWHERE g.group_name = 'confluence-users' AND cu.active = 'T'
It looks like you're new here. Sign in or register to get started.