Ok. It looks like I found the Jenkins java api class to give me what I want.

From: Danny Wong <[email protected]>
Date: Wednesday, January 25, 2017 at 10:39 AM
To: khmarbaise <[email protected]>, Jenkins Users 
<[email protected]>
Subject: Re: jenkins java api

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.

From: khmarbaise <[email protected]>
Date: Wednesday, January 25, 2017 at 10:37 AM
To: Jenkins Users <[email protected]>
Cc: Danny Wong <[email protected]>
Subject: Re: jenkins java api

Hi,

you should get only the appropriate job by selecting via name and then you can 
get information about a part of the job like a pipeline part...may be via the 
REST API ? I never tried to use this within a pipeline itself...

Kind regards
Karl Heinz Marbaise

On Wednesday, January 25, 2017 at 7:16:28 PM UTC+1, Danny Wong wrote:
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<http://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 
[email protected]<javascript:> and delete this message, along with any 
attachments, from your computer.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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 
[email protected] and delete this message, along with any attachments, 
from your computer.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ABC25C79-C7B9-4F94-816B-485E02E42CD1%40whitehatsec.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to