Display users in confluence groups

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

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

ah brilliant, thank you!

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,132 views 22 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you