Jenkins extended choice parameter groovy script is not working

2.4k Views Asked by At

I have to pass the build number from other job to a pipeline job. Below is my pipeline syntax page:

jenkins_pipeline_syntax

I have generated the below script:

    properties([parameters([<object of type com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition>])])

Below image is the script generated: enter image description here

But i am not able to use this properly. Please help, how to use the generated script for extended choice paramater.

1

There are 1 best solutions below

0
On

I use a similar plugin for the same goal - Extensible Choice Parameter plugin.

The following syntax works for me using this plugin:

properties([
        [$class: 'ParametersDefinitionProperty', parameterDefinitions: [
                [$class            : 'ExtensibleChoiceParameterDefinition',
                 name              : 'ParameterName',
                 description       : 'ParameterDescription',
                 editable          : 'false',
                 choiceListProvider: [$class      : 'SystemGroovyChoiceListProvider',
                                      groovyScript: [script: 'GroovyScriptAsString']
                 ]
                ]
        ]
        ]
])