-
New Feature
-
Resolution: Fixed
-
Minor
-
None
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
- 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