Reputation: 313
At the beginning of my pipeline a choice is made:
parameters {
choice(
name: 'jobRunMode',
choices: ['Create/Update','Delete'],
description: 'Job run mode')
}
However, when this build is triggered for the first time the user does not make a choice, thus this variable does not exist or is empty.
How do I check if this parameter exists or not?
Upvotes: 0
Views: 846
Reputation: 116
Instead of checking, just add Default Value to this param so it always exists xD.
Upvotes: -1
Reputation: 28774
A straightforward conditional for object value assignment would be: params.jobRunMode == null
.
Upvotes: 2