When a job is initially created, Jenkins does a bit of jumping through
hoops to set a flag that indicates "don't build this job until it has been
saved" this is to support the use case of somebody copying a job and
changing the scm to the new scm they want to build but finding that polling
has triggered a build with the old scm while they were configuring the job.

Thus all you need to do is trigger a save of the job after it has been
created in order to clear the flag... (the hoops that jenkins jumps through
is that it captures any "save" actions during the job creation and ignores
them while another flag is set, so your save call will have to wait until
those hoops have finished)

OTOH have you considered literate builds which give you a very nice job per
branch scheme that is IMHO exactly what people want!


On 8 October 2013 15:00, ashleycoker <[email protected]>wrote:

> A little background from above post:
>
> I am using https://github.com/entagen/jenkins-build-per-branch  to make
> Jenkins jobs according to GitHub branches - this uses the API to copy jobs
> from a template (that I know builds and works fine) job.
>
> I am using Jenkins V1.533.
>
> Its not as though the job is broken, as a simple save in the configuration
> in the web UI fixes the issue and the job can be built but as explained
> this
> required manual intervention which obviously is not the purpose of the CI
> server  ;-)
>
>
>
> --
> View this message in context:
> http://jenkins-ci.361315.n4.nabble.com/API-created-jobs-have-missing-Build-Now-link-and-don-t-run-tp3215035p4678612.html
> Sent from the Jenkins users mailing list archive at Nabble.com.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to