Question about the Confluence command line interface

C Hee March 18, 2014

What is the Confluence command that will, given the name of a confluence group, return its members? I do not have administrative privileges but I looked at 'getUserList' and getGroupList' - neither of them does what I need.

Any help would be appreciated.

3 answers

1 accepted

0 votes
Answer accepted
C Hee March 30, 2014

I will try the suggested queries. Thank you for the suggestions.

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
March 22, 2014

The Confluence remote API currently doesn't support what you are requesting, so the CLI doesn't either. If your instance shares users with JIRA, the JCLI does support this capability. Please open an issue and perhaps this can be supported in the future.

0 votes
Tiago Comasseto
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.
March 18, 2014

Hi, as per what I could see the in this doc, the parameter getUserList would return just the list of users and getGroupList would return just the list of groups, none of those parameters would return the list of members of a specific group.

Aparently there isn't an option to retrieve this information with command line interface, as an alternative you may consider SQL queries as these examples:

This query will return the list of group that are member of the GroupA:

SELECT g.group_name FROM cwd_group g join cwd_membership m on g.id=m.child_group_id WHERE m.parent_id = (select id from cwd_group where group_name = 'GroupA') and m.child_group_id is not null;

This query will return only nested members of GroupA:

select u.id, u.user_name, g.group_name from cwd_user u
join cwd_membership m on u.id=m.child_user_id join cwd_group g on m.parent_id=g.id join cwd_directory d on d.id=g.directory_id
where g.group_name in (SELECT g.group_name FROM cwd_group g join cwd_membership m on g.id=m.child_group_id WHERE m.parent_id = (select id from cwd_group where group_name = 'GroupA') and m.child_group_id is not null) and d.directory_type='CROWD' order by g.group_name;

This query will return only direct members of GroupA:

select u.id, u.user_name from cwd_user u
join cwd_membership m on u.id=m.child_user_id join cwd_group g on m.parent_id=g.id join cwd_directory d on d.id=g.directory_id
where g.group_name = 'GroupA' and d.directory_type='CROWD' order by g.group_name;

This query will return the complete list of members of GroupA. Direct members, plus Nested members:

select u.id, u.user_name, g.group_name from cwd_user u
join cwd_membership m on u.id=m.child_user_id join cwd_group g on m.parent_id=g.id join cwd_directory d on d.id=g.directory_id
where g.group_name in (SELECT g.group_name FROM cwd_group g join cwd_membership m on g.id=m.child_group_id WHERE m.parent_id = (select id from cwd_group where group_name = 'GroupA') and m.child_group_id is not null) and d.directory_type='CROWD' or g.group_name = 'GroupA' and d.directory_type='CROWD' order by g.group_name;
Cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events