In Jenkins, I want to list all Jenkins jobs using the groovy script, I have tried a couple of groovy scripts to get the jobs, and it's working fine, Now I want to get the count of all Jobs without folders and subfolders. Below is the groovy script which I have tried to the all jobs list including folder and subfolders, but I need only jobs which are WorkflowJob, FreestyleProject, and maven build
Jenkins.instance.getAllItems(Job.class).each{
println it.name + " - " + it.class
}
and 2 one is how can I get a list of active jobs and disabled jobs list and count I have tried from below reference, but it's not working
find disabled job link found in google
Someone please can help on this, help is much appreciated