The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
👋 Hello Community! My name is Stephanie Zhang, and I’m a product manager on the Confluence cloud team. Today, I’m excited to announce the rollout of Presenter Mode : a ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.