Scheduling a build does not assign a build number. Starting a build does. So it is not yet known at that point in time.
These should help however, as these will give you the actual build (and not get confused by jobs enabled for parallel building): http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#scheduleBuild2%28int%29 http://javadoc.jenkins-ci.org/hudson/model/queue/QueueTaskFuture.html#waitForStart%28%29 Please see my comments to the related JENKINS-12827 for an explanation and solution when using the remote API. On 28.05.2015, at 09:54, Yotam Eliraz <yotam.eli...@gmail.com> wrote: > > I want to lunch a build by Jenkins API and get in return the build number > that this call has started. However, because of synchronizations > considerations, I don't want it to happened in 2 seprate calls (like: > lunchJobBuild(), getJobLatestBuildNumber()), but instead I am looking for an > API call that gets inreturn the specific buildNumber that was just now > created (in the reply content for example..). Is such a API call exists? > > Thanks! > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/130a72aa-1eef-46b0-83ed-09218b9562c3%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4F7663FC-83D4-4E29-AD19-EEE559AB5A72%40beckweb.net. For more options, visit https://groups.google.com/d/optout.