Start jenkins job immediately after creation by seed job Start jenkins job immediately after creation by seed job jenkins jenkins

Start jenkins job immediately after creation by seed job


You can use queue DSL command to schedule a build, see https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands#queue.

To queue the job only if it's new, you need to use the Jenkins API to test if the job already exists.

if (!jenkins.model.Jenkins.instance.getItemByFullName('my-job')) {    queue('my-job')}