4 comments

  • Avatar
    Ryan Wren Official comment

    This script will provide that information for you:

    Jenkins.instance.getAllItems(AbstractItem.class).eachWithIndex{ it, index ->
    if(it == Jenkins.instance.getAllItems(AbstractItem.class).last()) {
    println(index + " total jobs\n")
    }
    }

    Jenkins.instance.getAllItems(AbstractItem.class).each{
    println(it.fullName)
    }

    For more context - https://support.cloudbees.com/hc/en-us/articles/226941767-Groovy-to-list-all-jobs

  • 0
    Avatar
    Raja Maganti

    Thanks Ryan.

    I am sorry . I need a script to count the number of Jenkins Jobs.

     

  • 0
    Avatar
    Ryan Wren

    If you navigate to the Manage Jenkins -> Script Console page on your Jenkins master, copy/paste the Groovy script in my previous comment, and run the script - you will see the number of jobs as well as the list of jobs.

  • 0
    Avatar
    Rameshmari Please Update

    how to copy a folder to another location of the folder

Please sign in to leave a comment.