title: Jenkins Job to check failed job within 24 hours
body: <p>This script gives me all Jenkins failed jobs. However, I am trying to see failed jobs from last 24 hours only. Is there a way i can get failed job based on time?</p>
  
  <pre><code>    def jobBuilds=it.getLastFailedBuild()
      jobBuilds.each { build -&gt;
        def currentStatus = build.buildStatusSummary.message
        if (currentStatus.contains("broken")) {
          println "Build: ${build} | Status: ${currentStatus}"
        }
      }
    }
  
  **My Jenkins Console output**
  
  Last Failed Job and Build: 24-hours-job-status #20 | Status : broken since build #18
  [Pipeline] echo
  Last Failed Job and Build: analyze #29 | Status : broken since build #28
  [Pipeline] echo
  Last Failed Job and Build: build-status #11 | Status : broken since this build
  [Pipeline] echo
  Last Failed Job and Build: git-hub-project #4 | Status : broken since this build
  [Pipeline] echo
  Last Failed Job and Build: job1 #2 | Status : broken since this build
  [Pipeline] echo
  Last Failed Job and Build: job2 #2 | Status : broken since this build
  [Pipeline] echo
  Last Failed Job and Build: job3 #2 | Status : broken for a long time
  [Pipeline] echo
  Last Failed Job and Build: job4 #6 | Status : broken since build #3
  [Pipeline] echo
  Last Failed Job and Build: success-failed-job #54 | Status : broken since build #53
  [Pipeline] End of Pipeline
  Finished: SUCCESS
  </code></pre>