I am trying to write a groovy script for a job to have a choice parameter. One of the choices would a string with space in between ( i.e 'test env' ). Is there any way we can achieve that ?
Current code parameters { choice(name: 'environment_name', description: 'The environment name',choices: 'test\ntest env') }
Is there any way we can achieve this in groovy ?
CodePudding user response:
Just use a list for choices
:
parameters {
choice(name: 'environment_name',
description: 'The environment name',
choices: ['test','test env'])
}