Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a list of builds from Jenkins that have been running in the past 24 hours?

Tags:

jenkins

So I know how to get a list of the current running jobs from Jenkins: From Jenkins, how do I get a list of the currently running jobs in JSON?

Is there a way to get a list of all the jobs which have ran on Jenkins within the last 24 hours?

like image 379
Village Avatar asked Oct 19 '22 12:10

Village


1 Answers

I don't know of a way to get Jenkins to perform the date filtering for you. So this approach is similar to a previous answer of mine.

You can get a list of all jobs and builds with a query like: http://jenkins:8080/api/json?tree=jobs[name,builds[fullDisplayName,id,number,timestamp]]&pretty=true

Then use the id or timestamp field to filter for builds generated after your target date.

like image 80
Dave Bacher Avatar answered Oct 23 '22 01:10

Dave Bacher