Details
-
New Feature
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
Description
Currently, when using the "stage-level" input (here: https://jenkins.io/doc/book/pipeline/syntax/#input) the when condition of the stage is evaluated after the input is gathered. We should add an option so the when condition is evaluated before the input is gathered. Something like:
stage('Production Deploy') { agent { label 'linux' } when { branch "master" beforeInput true } input { message 'Deploy to Production?' } steps { echo 'Deploying to Production ... ' } }
Use cases
- Evaluate the when condition before the input has been gathered.
In scope
- Declarative pipeline only
- Only used for input at stage level https://jenkins.io/doc/book/pipeline/syntax/#input
Attachments
Issue Links
- is duplicated by
-
JENKINS-52745 Stage input runs before when conditional
-
- Fixed but Unreleased
-
-
JENKINS-49947 unclear usage of input step in declarative pipeline
-
- Closed
-
-
JENKINS-52240 input directive is not respecting when condition
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Summary | Create a new stage option for running when condition before stage input | Create a new option for running when condition before stage input |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Assignee | Erik Elkins [ elkins ] | Andrew Bayer [ abayer ] |
Assignee | Andrew Bayer [ abayer ] | Jose Blas Camacho Taboada [ jtaboada ] |
Description |
Currently, when using the "stage-level" input (here: [https://jenkins.io/doc/book/pipeline/syntax/#input)] the when condition of the stage is evaluated after the input is gathered. We should add an option so the when condition is evaluated before the input is gathered. Something like: {code:java} stage('Production Deploy') { agent { label 'linux' } when { branch "master" beforeInput: true } input { message 'Deploy to Production?' } steps { echo 'Deploying to Production ... ' } }{code} *Use cases* * Evaluate the when condition before the input has been gathered. *In scope* * Declarative pipeline only * Only used for input at stage level https://jenkins.io/doc/book/pipeline/syntax/#input |
Currently, when using the "stage-level" input (here: [https://jenkins.io/doc/book/pipeline/syntax/#input)] the when condition of the stage is evaluated after the input is gathered. We should add an option so the when condition is evaluated before the input is gathered. Something like: {code:java} stage('Production Deploy') { agent { label 'linux' } when { branch "master" beforeInput true } input { message 'Deploy to Production?' } steps { echo 'Deploying to Production ... ' } }{code} *Use cases* * Evaluate the when condition before the input has been gathered. *In scope* * Declarative pipeline only * Only used for input at stage level https://jenkins.io/doc/book/pipeline/syntax/#input |
Status | Open [ 1 ] | In Progress [ 3 ] |
Link |
This issue is duplicated by |
Status | In Progress [ 3 ] | In Review [ 10005 ] |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10005 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
We have the same requirement, business case is following: