JackSparow
JackSparow

Reputation: 179

How to get the build history in Jenkins using its API?

I want to retrieve the build history (List of completed builds) of a job in Jenkins using Jenkins API. Which URL I should use?

Upvotes: 1

Views: 7244

Answers (1)

Siddharth Kaul
Siddharth Kaul

Reputation: 972

Something like the following:

https://<jenkins_host>/job/<job_name>/api/xml?tree=allBuilds[id]

This will return you all the ids of all builds under the <job_name>

EDIT: To get all builds of all jobs:

https://<jenkins_host>/api/xml?tree=jobs[name,allBuilds[id]]

Caution here, this will be a very very huge files as you may have lots of jobs and lots of builds for each job.

Upvotes: 3

Related Questions