For instance:
j = hudson.model.Hudson.instance.getJob("myjob")
prinln j.getName()
println j.isBuilding()
println j.isInQueue()
How do i get the date of the last build?
I assume i have to this, but then what?:
runt = j.getLastBuild()
runt.????? -> (I can't figure out which function to call)
Thanks
--
View this message in context: http://jenkins.361315.n4.nabble.com/How-to-get-the-last-build-date-time-via-groovy-script-tp3490988p3490988.html
Sent from the Jenkins users mailing list archive at Nabble.com.
item = hudson.model.Hudson.instance.getItem("job_name")
build = item.getLastBuild()
println build.getTime()
(you can use getLastStableBuild, or getLastFailedBuild() or any of the others depending on what you want)
Ian
--
View this message in context: http://jenkins.361315.n4.nabble.com/How-to-get-the-last-build-date-time-via-groovy-script-tp3490988p3492811.html