I'm working on the groovy script to get all active multibranch pipelines and disabled multibranch pipeline list
Below is the groovy script and I was able to get this
To get the list of multibranch pipelines
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject).each {multibranchpipelines->
println("multibranchpipelines Job Names: " + multibranchpipelines.getFullName())
}
To get the list of disabled multibranch pipelines
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob).each {multibranchpipelines->
if(multibranchpipelines.isDisabled()) {
println("multibranchpipelines Job Names: " + multibranchpipelines.getFullName())
}
}
Now I want to get all the jobs list which is in multibranch pipelines active and disabled separately
I have tried multiple scripts, but still not able to get the required, can someone has ideas or groovy scripts that I can use to get this
Also, once we get the list, can I get the count of those active and disabled
And finally, I want to get the list of all jobs which exclude disabled multibranch pipelines and their branches