Script - user list (groovy)
List all users
How to use
Example scripts can be used in one of 3 different ways:
- Directly via url:Â https://bitbucket.org/bob_swift/examples/raw/tip/confluence/groovy/userList.groovy
- Download to the script folder in your Confluence home directory and use script=#userList.groovy
- Copy the script into the macro body
View source
Requirements
- Scripting for Confluence 4.3 or above
- Confluence 4.2 or above
Tested
This script (latest version in Bitbucket) is tested during release testing using GINT
All users
{groovy:output=wiki|script=#https://bitbucket.org/bob_swift/examples/raw/tip/confluence/groovy/userList.groovy} {groovy}
All users with code copied to macro body
{groovy:output=wiki} /** * Get a list of all users * Requires: output=wiki * Requires: Scripting for Confluence 4.3 or above * Requires: Confluence 4.1 or above */ Â out.println "|| User ID || Full name || Email ||" userAccessor.getUsersWithConfluenceAccessAsList().sort().each { user -> out.println "| $user.name | [~$user.name] | [mailto:$user.email] |" } {groovy}