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

Conditional application of triggers in Declarative

      I want to be able to use trigger with cron but only for the master branch.

      if and when both don't work in the trigger context.

      Here is what I expected to work:

       

      if (env.BRANCH == 'master') {
        trigger { cron('@daily') }
      }
      

          [JENKINS-42643] Conditional application of triggers in Declarative

          Christian Höltje created issue -
          Andrew Bayer made changes -
          Summary Original: when/if doesn't work in trigger New: Conditional application of triggers in Declarative
          Andrew Bayer made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          Andrew Bayer made changes -
          Link New: This issue is duplicated by JENKINS-48898 [ JENKINS-48898 ]
          Christoph Läubrich made changes -
          Link New: This issue relates to JENKINS-52203 [ JENKINS-52203 ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]

            Unassigned Unassigned
            docwhat Christian Höltje
            Votes:
            48 Vote for this issue
            Watchers:
            61 Start watching this issue

              Created:
              Updated: