How to find out the number of jobs from each job types

Article ID:360031145972
1 minute readKnowledge base


  • I want to know how many freestyle/maven/pipeline jobs there are in Jenkins.


Using Groovy Script

You can run a script from the Groovy Script Console under Manage Jenkins -→ Script Console:

Set<String> jobTypes = new HashSet<String>();

Jenkins.instance.allItems(AbstractItem.class).each {

jobTypes.each { clazz ->
  println clazz.getCanonicalName() + ": " + Jenkins.instance.getAllItems(clazz).size()

println "--------------------------------------------------------------------------"
println "Total items : " + Jenkins.instance.getAllItems(AbstractItem.class).size()


Other useful groovy scripts can also be found in:

Using Support Bundle

You can also find the job statistics from the support bundle. Here is how:

2) Generate a support bundle.

3) Unzip the file

4) Aggregate job type statistics can be found under the root folder in file.

Tested product/plugin versions

  • CloudBees Jenkins

  • CloudBees Support Plugin 3.22