Cannot remove properties from Jenkinsfile for Pipeline from SCM

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      In Pipeline Multibranch (and in general for Pipeline from SCM), when removing properties from a Jenkinsfile the properties of the branch job are not updated.

      Example

      1) I create a Jenkinsfile with Triggers:

      properties([pipelineTriggers([[$class: 'TimerTrigger', spec: 'H * * * *']])])
      
      node {
           ...
      }
      

      After branch indexing, the trigger is correctly set for the job

      2) Now I want to remove this trigger. I remove the properties step:

      node {
           ...
      }
      

      I trigger a branch indexing

      Expected result: My job configuration has no trigger
      Actual result: The trigger is still there


      Workaround

      So pipeline updates the properties only if the properties step is set in the Jenkinsfile. There is therefore a workaround.

      In this particular scenario, if I want to get rid of the trigger, I need to update to something like this first:

      properties([pipelineTriggers([])])
      // or also `properties([])`
      
      node {
        ...
      }
      

            Assignee:
            Unassigned
            Reporter:
            Allan BURDAJEWICZ
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: