pipeline {
agent any
parameters {
booleanParam defaultValue: true, description: '', name: 'p1'
}
environment {
NOT_P1 = "${(!params.p1) ? 'true' : 'false'}"
}
stages {
stage('JENKINS-54047') {
steps {
// If p1 == true, then this prints "expecting false, got true"
// If p1 == false, then this prints "expecting true, got false"
echo "expecting ${!p1}, got ${NOT_P1}"
}
}
}
}