Home > database >  triggers directive not executed in Jenkins within pipeline script
triggers directive not executed in Jenkins within pipeline script

Time:09-27

I'm trying to build a pipeline script which basically works. Now I tried to move the pollSCM trigger from the configuration, where it is unchecked now, into the pipeline script. See screenshot:

pipeline script

It works with the checkbox, so new code triggers the build, but I want to get it working via pipeline script. Unfortunately, nothing is being triggered, although I checked in some new code.

The syntax seems to be correct, see https://www.jenkins.io/doc/book/pipeline/syntax/#triggers

Any idea why the job is not triggered from the pipeline script?

CodePudding user response:

You need to trigger the Pipeline once manually for those configurations to be picked up. Once you execute the Pipeline after adding the triggers you should see the check mark automatically getting added.

  • Related