Skip to content

Instantly share code, notes, and snippets.

@justlaputa
Last active February 4, 2026 13:12
Show Gist options
  • Select an option

  • Save justlaputa/5634984 to your computer and use it in GitHub Desktop.

Select an option

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

@pfuntner
Copy link

pfuntner commented Feb 4, 2026

My team's Jenkins server recently had an upgrade and I'm getting errors from a REST URL such as jenkins_url + /job/${job_name}/lastBuild/api/json with the nastygram ... /api/json not currently supported without ?tree. Some of your other examples that have tree= help me fix my URLs.

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