Hi guys,
I would like to retrieve all the jobs (and their name) in a specific Jenkins pipeline. I’m looking at Jenkins api using groovy examples, but I have not found the option.
I found this example:
// Get the list of all jobs and print them
//activeJobs = hudson.model.Hudson.instance.items.findAll{job -> job.isBuildable()}
//activeJobs.each{run -> println(run.name)}
//println ('total number of jobs :'+ activeJobs.size())
Which gives me ALL builds and their names… I only want the builds from a specific pipeline view. Any suggestions? Thanks!
______________________________________________________________________
The contents of this electronic message, including any attachments, are intended only for the use of the individual or entity to which they are addressed and may contain confidential information. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this message or any attachment is strictly prohibited. If you have received this transmission in error, please send an e-mail to postm...@whitehatsec.com and delete this message, along with any attachments, from your computer.
Hi,
I can get all the build names via REST api fine when I make an external call to a python script. I wanted to try implementing within Jenkins groovy scripting.
Ok. It looks like I found the Jenkins java api class to give me what I want.