How can I use the Extended Choice Parameter plugin in a Jenkins pipeline script?

Here is my workaround for this pb:

https://gist.github.com/jgraglia/44a7443847cff6f0d87387a46c7bb82f

ie : manually instanciate the parameter by declaring all the args

I was able to add a multi checklist parameter to my pipeline with that.


Since April's 2nd, 2019 it's now possible because of this commit: https://github.com/jenkinsci/extended-choice-parameter-plugin/pull/25

You can use it like this for instance:

properties([
    parameters([
        extendedChoice( 
            name: 'PROJECT', 
            defaultValue: '', 
            description: 'Sélectionnez le projet à construire.', 
            type: 'PT_SINGLE_SELECT', 
            groovyScript: valueKeysScript,
            descriptionGroovyScript: valueNamesScript
        )
    ])
])

If you want to know every possible parameter you have to refer to the source code. If you want to know every possible value for the "type" key, have a look at the PT_* constants.