user list with profile pictures


How can I create a more fancy User List. I want to show a table of the user that belong to one or more groups.

The {user-list} macro gives me the right info, but I would like to show it in a table with each user's profile picture instead of the basic layout the macro currently gives.

I could of course build this list manually, but the whole point is of course that this User List is automatically generated.

Thanks a lot.

6 answers

Have you ever built a custom macro? That's the way to do it. The UserAccessor class ( has a getUserProfilePicture() method, so that would get the image for you (or at least should get you started).

So here's a basic macro that just gets the username/email, profile picture, and list of groups they are in. I didn't make it nice or anything, but hopefully it'll help you get started:

## Macro title: User Info
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
## Developed by: Matthew J. Horn
## Date created: 2/25/13
## Installed by: <your name>
## Macro to display some user info
## @noparams

#set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager = $getInstanceMethod.invoke(null,null))
#set($containerContext = $containerManager.containerContext)

#set($loginManager = $containerContext.getComponent('loginManager'))
#set($crowdService = $containerContext.getComponent('crowdService'))
#set($users = $userAccessor.getUsers())

<table class="confluenceTable">
    <th class="confluenceTh">User</th>
    <th class="confluenceTh">Profile Image</th>
    <th class="confluenceTh">Groups</th>

#foreach($user in $users)
  #set($crowdUser = $crowdService.getUser($
      <td class="confluenceTd">#usernameLink($</td>
      <td class="confluenceTd"><img src="$userAccessor.getUserProfilePicture($user).getDownloadPath()"/></td>
      <td class="confluenceTd">$userAccessor.getGroupNamesForUserName($</td>

Waw. This is amazing input.

I'll see if I find some time later this week to get this up and running.

Much appreciated!

Hi Matthew,

I tried your macro and think I start to understand how to use it for my case.

However, I could use one little extra hint:

What is the simplest way to get only those users that belong to a defined group (given as a parameter)? It seems easier to get a list of groups a user belongs to ($userAccessor.getGroupNamesForUserName($ then the other way around...

Should I start checking the GroupNamesForUserName output and compare it to the input-parameter to decide whether the user belongs to the group or not? This seems a bit convoluted, doesn't it?

Or is there a command like GetUsers($ I could not find that so easily in the documentation. (Perhaps I just didn't look hard enough, sorry...)

Much appreciated!

Hello Bert,

I am not sure what version of Confluence you are on, but more modern version of Confluence have a people direcotry. This is a place where you can see a photo and a short blurb of information abotu a given person. I am including a document below on how you search through the people direcotry to find those users that you are interested in.

You other option would be to write a custom user macro to acheive this functionality. We have a document on wirting these macros which I will include.

Please let us know if you have any questions on these documents.

Thanks a lot for the answers.

Unfortunately I am not an avid programmer and being new to Confluence I guess I was hoping to find a more 'straightforward' answer.

Guess I will have to slowly dig into making these custom macros, then... Always good to get some exercise... ;-)

Bert, if I have some time later today, I'll see if I can help get you started. But I can assure you that once you start creating macros, you'll start to see some really interesting things you can do with Confluence.

Good question. Its pretty simple, but you have to start getting used to looking at the Confluence APIs to find it. Here's the link:

In this case, you're using the UserAccessor class's getMemberNames() method:


This method takes a Group object, not a string, so you have to get the group first. There's lots of ways to do this, but the easiest is probably to pick it out of a list from the getGroups() method.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

462 views 3 18
Read article

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