Skip to content

Instantly share code, notes, and snippets.

@justlaputa
Last active September 26, 2023 17:43
Show Gist options
  • Save justlaputa/5634984 to your computer and use it in GitHub Desktop.
Save justlaputa/5634984 to your computer and use it in GitHub Desktop.
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

  • all build info:

jenkins_url + /job/${job_name}/lastBuild/api/json

  • build progress:

jenkins_url + /job/${job_name}/lastBuild/api/json?tree=result,timestamp,estimatedDuration

timestamp = start time

estimatedDuration = duration

@monkpit
Copy link

monkpit commented Jan 29, 2020

How do I get all jobs including those within folders?

EDIT: Found this which is an answer, but not a very satisfying one:

https://stackoverflow.com/questions/26236206/jenkins-remote-api-is-it-possible-to-retrieve-the-complete-job-tree-using-the

@Jatin887
Copy link

i am getting a 504 error what can be the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment