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.

Reply via email to