I second this. It would be really nice to see the actual build number created in the response somewhere when using the api build and buildWithParameters calls. We can try to figure it out based on the nextBuildNumber, plus parsing through the queue/api/xml output, but it is not guaranteed.
I created a Jira for this, hopefully "core" is the right Component? https://issues.jenkins-ci.org/browse/JENKINS-12827 On Fri, Feb 3, 2012 at 9:52 PM, Nataly Naumova <smyau...@gmail.com> wrote: > I did it using http parsing, but it is not a good solution. > Also the build can come to queue? and there can be problems with build > number, because it will depend from builds priority in such case. > The best way is to use groovy script for triggering build and getting the > build number then. > > 2012/2/3 Gaetano Giunta <g...@ez.no> >> >> Hello >> >> I have read the doc, and google around, but I have found no solution >> so far to the problem of triggering a build via an http call and >> getting back a build number (eg json-encoded) instead of a 302 >> redirect to the page listing project status. >> >> I can call http://jenkins-server/job/my_project/build?delay=0sec, but >> I get redirected to an html page that I have to scrape to understand >> if a new build is undergoing - and I am not even sure to be able to >> trap any error messages that would be in there. >> >> I tried doing GET calls to both >> http://jenkins-server/job/my_project/build/api/json >> and http://jenkins-server/job/my_project/api/json/build, to no avail. >> >> Is this possible at all? > > > > > -- > Best regards, > Nataly N.