I want to generate a report that shows a listing of all groups in our Confluence instance. Anyone done anything like this?
Thanks!
You could do it with a user macro.
## Developed by: Davin Studer ## Date created: 04/21/2015 ## @noparams <ul> #foreach($group in $userAccessor.getGroups()) <li>$group</li> #end </ul>
Just in case the special characters in Davin's script causes issues like they did for me - this slightly changed version worked flawlessly for me (Confluence version 6.4):
## Developed by: Davin Studer
## Date created: 04/21/2015
## @noparams
<ul>
#foreach($group in $userAccessor.getGroups())
<li>$group</li>
#end
</ul>
Thanks, @Davin Studer. Awesome little script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, unfortunately when these posts were migrated from the old Atlassian Answers site the code blocks were html encoded, which messes up the code. : (
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bob,
You can get a list of all group names by running a query against your database. For instance:
select group_name from cwd_group;
It's also possible to retrieve the directory name that this group comes from and other kind of information you might need.
Let me know if that helps!
Eduardo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
similarly from the java api
public class MyClass extends ConfluenceActionSupport{ private final UserAccessor useraccessor; public MyClass(UserAccessor userAccessor){ this.useraccessor=userAccessor; } public String execute() { //do something with useraccessor.getGroups() } }
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.