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))
<ac:structured-macro ac:name="profile">
<ac:parameter ac:name="user">
<ri:user ri:userkey="$confluenceUser.key" >
</ac:parameter>
</ac:structured-macro>
#end
Any pointers would be appreciated.
Unfortunately, no :( I sort of gave up on the effort, so we manually manage users profiles.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.