Child pages
  • Printing a list of credentials and their IDs

Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Printing a list of all the credentials in the system and their IDs.

  def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
  for (c in creds) {
       println( + ": " + c.description)
  • No labels


  1. Unknown User (ramakrishnaraov)

    I see a security risk here, if somebody's credential is configured then anybody who has access to run this script can see the user name and password of all the configured credentials.

    for (c in creds) {
           println( + ": " + c.description)
           if(c instanceof com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials)

    Unknown macro: {           print c.getUsername()           print c.getPassword()                  }


    1. Unknown User (akostadinov)

      This is admin anyway.