I did some research and I was unable to pass these types of parameters to a second job, which uses the same parameter. I doubt it's not possible, since there is no "value" type which can be passed to this plugins parameter class.
So the only option I see here, is just to use a string parameter in the second job. I guess in the second job you already do some parsing of that parameter value, so you won't need to change much:
properties([
parameters([
[$class: 'ChoiceParameter',
choiceType: 'PT_MULTI_SELECT',
filterLength: 1,
filterable: false,
name: 'TEST_PARAM',
script: [
$class: 'GroovyScript',
fallbackScript: [
classpath: [],
sandbox: false,
script: 'return ["Check Jenkins ScriptApproval page"]'
],
script: [
classpath: [],
sandbox: false,
script: 'return ["One","Two:selected"]'
]
]
]
])
])
pipeline {
agent any
stages {
stage('Test') {
steps {
print params.TEST_PARAM
build job: 'test2', parameters: [
string(name: 'TEST_PARAM', value: "${params.TEST_PARAM}")
]
}
}
}
}
And then in the second job (Name = test2):
pipeline {
agent any
parameters {
string(name: 'TEST_PARAM', defaultValue: '')
}
stages {
stage('Test') {
steps {
script {
// split values, guess you're doing this already
// since the value of the parameter is also comma-separted
// when you get from "Active choice parameter"
def testParamValues = "${params.TEST_PARAM}".split(',')
testParamValues.each { testParamValue ->
print testParamValue.trim()
}
}
}
}
}
}
If you want to use both, the "Active choice parameter" and that string parameter in your pipeline, you could just check which one has a length > 0 and then work with that value.