Skip to content

Instantly share code, notes, and snippets.

@nkhine
Forked from justlaputa/jenkins-api.md
Created July 18, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkhine/4ebd1c140bcedc58d9ee8c461a47d034 to your computer and use it in GitHub Desktop.
Save nkhine/4ebd1c140bcedc58d9ee8c461a47d034 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

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