You should be able to make an http request
http://HUDSON_URL/job/JOBNAME/BUILDNUMBER/stop
and you can make an xpath request to get the build number
http://HUDSON_URL/job/JOBNAME/api/xml?xpath=//lastBuild/number/text()
There may be a way to insert lastBuild or lastBuild instead of BUILDNUMBER, but if not, you can just use the 2 http gets.
aflat
source share