I'm writing a Jenkins plugin and I want to retrieve last build information (number, timestamp) for a given job from Jenkins api. I can do following REST call and obtain it.
<url_to_jenkins>job/<job name>/api/json?tree=builds[number,status,timestamp,id,result] Since my plugin is also deployed inside Jenkins is there a way to get this info by calling direct JAVA api instead of this REST call ?