I want to list users of a group, but if the group not exists, i get an error
## Users Pictures for Group - Confluence User Macro
##
## Produces a pile of user profile pictures for members of a specific group
##
## WARNING:
##
## Use very sparingly as this *will* slow down large Confluence instances.
## Yes, it will try to print out 100,000 users if you have that many in the group
##
## I generally remove this user macro after using once and add only when needed.
## Or enable it for admins only.
##
## @param Group:title=Group Name|type=string|required=true|desc=The group name (yes, really)
#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) )
#set($komma="")
#foreach( $username in $users )
#if ( $username != "service" )
$komma
#usernameLink($username)
#end
#set ($komma=",")
#end
is there a way to catch this erorr and wrote a message "Unknown group" ?
Hi!
Looks like getMemberNamesAsList gets so slow.
Because I have met the same situation in my plugin .
Have you fix it?
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.