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

Provide means of detecting cause of build from declarative pipeline

    Details

    • Similar Issues:

      Description

      I'd like to be able to perform certain steps on my declartive pipeline when the build has been triggered via a nightly schedule, but not when it is triggered via SCM polling.

        Attachments

          Issue Links

            Activity

            Hide
            jtaboada Jose Blas Camacho Taboada added a comment -

            This feature was implemented using run.getCauses() within a script in Utils.groovy

            Show
            jtaboada Jose Blas Camacho Taboada added a comment - This feature was implemented using run.getCauses() within a script in Utils.groovy
            Hide
            abayer Andrew Bayer added a comment -

            Merged, will be in 1.3.4.

            Show
            abayer Andrew Bayer added a comment - Merged, will be in 1.3.4.
            Hide
            ccaraivan Costin Caraivan added a comment -

            Andrew Bayer Is this documented somewhere? How do we use this? Thanks!

             

            Show
            ccaraivan Costin Caraivan added a comment - Andrew Bayer Is this documented somewhere? How do we use this? Thanks!  
            Hide
            jtaboada Jose Blas Camacho Taboada added a comment -

            Costin Caraivan, you can check the documentation here: https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline

            And an example is: 

            when { triggeredBy 'SCMTrigger' }

            or TimerTrigger

            Show
            jtaboada Jose Blas Camacho Taboada added a comment - Costin Caraivan , you can check the documentation here: https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline And an example is:  when { triggeredBy 'SCMTrigger' } or TimerTrigger
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

              • Assignee:
                jtaboada Jose Blas Camacho Taboada
                Reporter:
                keirlawson Keir Lawson
              • Votes:
                2 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: