Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42785

Parameterized Pipeline Projects have their Build Triggers unset after each build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

      This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

      I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

      Specifically, the following settings, if set before the build is run, become uncheckmarked:

      • Build after other projects are built
      • Build periodically
      • GitHub hook trigger for GITScm polling
      • Poll SCM

      Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

      Here is an example Pipeline script that reproduces this problem for me:

      pipeline {
          agent any
          parameters {
             string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')
          }
          stages {
             stage('stage1') {
                steps {
                   echo 'Running stage 1'
                }
             }
          }
       }

       

      Conversely, the following doesn't lose the scheduling settings:

      pipeline {
          agent any
          stages {
             stage('stage1') {
                steps {
                   echo 'Running stage 1'
                }
             }
          }
       }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                keithzg Keith Zubot-Gephart
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: