I know I can call localhost/job/RSpec/lastBuild/api/json to get the status of the lastest Jenkins build. However, since our build runs very long (a couple hours
localhost/job/RSpec/lastBuild/api/json
To get the last successful build number:
curl --user https:///job//api/xml?xpath=/*/lastStableBuild/number