I want to put multiple when clause in a single stage. Here is the basic example
def foo = 0
pipeline {
agent any
stages {
stage('Hello') {
when {
expression {foo == 0}
}
steps {
echo 'foo is 0'
}
when {
expression {foo == 1}
}
steps {
echo 'foo is 1'
}
}
}
}
When I try this I recieve an error
Multiple occurrences of the when section
Actually my real problem is different but solving this will probably solve my real problem. Thanks in advance