I'm trying to write a user macro that the user can input/select a group and the macro will render the profiles for each of the members of the group. This would allow members to float in and out of the groups without needing to manually update individual user profile macros. I've read and tried to mimic how this was done in several other community posts. This is what I've come up with so far, but it's returning an error while rendering:
## Users Pictures for Group - Confluence User Macro
## Produces a pile of user profile pictures for members of a specific group
## @param Group:title=Group Name|type=string|required=true|desc=The group name
#set($containerManagerClass = $action.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager = $getInstanceMethod.invoke(null, null))
#set($containerContext = $containerManager.containerContext)
#set($userAccessor = $containerManager.containerContext.getComponent('userAccessor'))
#set($groupManager = $containerManager.containerContext.getComponent("groupManager"))
#set($group = $groupManager.getGroup($paramGroup))
#set($users = $userAccessor.getMemberNamesAsList($group) )
#foreach( $username in $users )
#set($confluenceUser = $userAccessor.getUserByName($username))
<ri:user ri:userkey="$confluenceUser.key" >
Any pointers would be appreciated.
Hello Confluence Community! What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. (Read m...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events