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

This script activates Chuck Norris plugin for all jobs in your Jenkins server


import jenkins.model.*


for(item in Jenkins.instance.items) {
     println("job $item.name")
     item.publishersList.replace(new  hudson.plugins.chucknorris.CordellWalkerRecorder());
}
  • No labels

5 Comments

  1. Unknown User (gkonovalenko)

    Must have script!

    1. Unknown User (amonsen)

      Can you just run the above in the Groovy console?

  2. Unknown User (yurymilchenko)

    You can run in main Jenkins Script Console or from System Groovy Script (groovy plugin) from Jenkins job.

    1. Unknown User (gkonovalenko)

  3. Unknown User (k4cy)

    Just a little modification to avoid errors when property does not exists (smile)


    import jenkins.model.*

    for(item in Jenkins.instance.items) {
        println("job $item.name")
          if (item.hasProperty('publishersList'))
            item.publishersList.replace(new  hudson.plugins.chucknorris.CordellWalkerRecorder());
    }