Display users in confluence groups

lazy boy May 27, 2015

Hi,

 

I am using the user macro below (thanks Davin).

 

Is it possible expand on this macro and display the users contained in a specified group?

 

## Developed by: Davin Studer
## Date created: 04/21/2015
## @noparams
<ul>
#foreach($group in $userAccessor.getGroups())
    <li>$group</li>
#end
</ul>

 

Thanks for any help!

2 answers

1 accepted

2 votes
Answer accepted
Chander Inguva
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.
May 27, 2015

Hi,

          Please find a possible solution mentioned in the link mentioned below

https://confluence.atlassian.com/display/DOC/User+List+Macro

 

Hope this helps.

Regards

Chander Inguva

lazy boy May 27, 2015

ah brilliant, thank you!

0 votes
Alex Yasurek
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.
May 27, 2015

Hi,

I think you may need to use the getMembers() method: https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/user/UserAccessor.html#getMembers(com.atlassian.user.Group)

Haven't tested this but it would probably go something like this:

## @param Group:title=group|type=string|required=true|desc=Group name

<ul>
#foreach($group in $userAccessor.getGroups())
#if($group == $paramGroup)
#foreach($user in $userAccessor.getMembers($group))
<li>$user</li>
#end
#end
#end
</ul>

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events