Issue
I want to retrieve the build history (List of completed builds) of a job in Jenkins using Jenkins API. Which URL I should use?
Solution
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.
Answered By - Siddharth Kaul
Answer Checked By - Cary Denson (JavaFixing Admin)