I have a job scheduled in Jenkins and it has lets say 370 total builds. I can see the date right next to build number in the build history part of the page but when I try to access the JSON content of that page like http:localhost:8080/job/job_name/api/json
I am not getting that date for the latest build in that JSON content.
Any other way to access the date when the last build happended?
I have to use the same in Java so might be there is any API to access the Jenkins?
As Harshavardhan Konakanchi mentioned in his answer there's the /lastBuild/
URL path. You can get exactly the information you want by using:
<JENKINS_URL>/job/<JOB_NAME>/lastBuild/api/json?tree=timestamp
Example output:
{"timestamp":1467898403630}
See <JENKINS_URL>/job/<JOB_NAME>/lastBuild/api/
for a description of the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With