Skip to content

Instantly share code, notes, and snippets.

@icirellik
Last active April 25, 2017 09:55
Show Gist options
  • Save icirellik/001ca59b7df04d61cf52 to your computer and use it in GitHub Desktop.
Save icirellik/001ca59b7df04d61cf52 to your computer and use it in GitHub Desktop.
Jenkins 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

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

jenkins_url + /queue/api/json?pretty=true

jenkins_url + /api/json?depth=2&pretty=true&tree=jobs[name,lastBuild[number,duration,timestamp,result,changeSet[items[msg,author[fullName]]]]]

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