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

trigger properties in scripted pipeline require 2 builds to get registered

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-job-plugin
    • None

      When defining trigger in a declarative pipeline, it will suffice to write

      pipeline {
       agent any
      
       triggers {
         cron('H H(0-7) * * *')
       }
      }

      and build once. 

      After the first build accessing the job config UI will show the trigger configuration.

      However if you do the same thing with a scripted pipeline

       

      node {
          properties([pipelineTriggers([cron('H H(0-7) * * *')])])
      }
      

       

      you need two builds to register the trigger (it won't appear in the UI and won't be working until the second manual build).

       

            Unassigned Unassigned
            varmenise valentina armenise
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: