Generating a List of User Names by Group

Camden Coyle November 15, 2012

I would like to generate a list of User Names by their Confluence Group Membership. I want to use this list to send email alerts to the users for maintenance outages, etc. Is there a way to do this within Confluence, or can you provide a SQL query that I could use to get it directly from the database?

2 answers

2 votes
GuilhermeA
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.
December 18, 2012

Hello Camden,

You have either two options, to go to your Group Browser, and there have a list, but you still need to click next if there is lots of users. Or you can use the following query who will have the users by Group :)

select u.lower_email_address,g.group_name from cwd_user u inner join cwd_membership m on u.id=m.child_user_id inner join cwd_group g on g.id=m.parent_id order by g.group_name;

Hope this helps you, also I have made the query to select only emails and group names.

Cheers,

Guilherme

Glenn Rees
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 22, 2020

For just one group

select DISTINCT u.lower_user_name, u.lower_email_address, g.group_name 
from cwd_user u
inner join cwd_membership m
on u.id=m.child_user_id inner join cwd_group g
on g.id=m.parent_id
where g.group_name = 'mygroup'
order by g.group_name;
Like Rick Carini likes this
Phil Evans February 4, 2021

@Glenn Rees  this doesnt work

0 votes
Monique Khairuliana
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2020

Tweaking Guilherme's sql query to add extra info of username, first and last name:

select u.user_name, u.first_name, u.last_name, u.lower_email_address, g.group_name from cwd_user u inner join cwd_membership m on u.id=m.child_user_id inner join cwd_group g on g.id=m.parent_id order by g.group_name;
Tyler Anderson May 26, 2021

Why do I get this?

Msg 207, Level 16, State 1, Line 35
Invalid column name 'child_user_id'.

Completion time: 2021-05-26T13:47:30.0141037-04:00

 

When I change to just Child_ID I get a singular response. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events