Script - user list (groovy)

List all users

How to use

Example scripts can be used in one of 3 different ways:

View source

Requirements

  1. Scripting for Confluence 4.3 or above
  2. 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}