I want achieve Picture 3. If no need update, give default value. If need update, then give user input area.
I\'d like use active reactive Reference in Jenkins pipeline
========I made it====== here is the code.
parameters([
choice(name:"NeedUpgradePC",choices:['yes','no'],description: "Do you need upgrade your PC"),
[$class: 'DynamicReferenceParameter',
choiceType: 'ET_FORMATTED_HTML',
omitValueField: true,
description: 'Please provide a Elastic alias label',
name: 'PC_RAM',
randomName: 'choice-parameter-5631314456178624',
referencedParameters: 'NeedUpgradePC',
script: [
$class: 'GroovyScript',
fallbackScript: [
classpath: [],
sandbox: true,
script:
'return[\'nothing.....\']'
],
script: [
classpath: [],
sandbox: true,
script:
"""
if(NeedUpgradePC.equals('yes')) {
inputBox=""
} else {
inputBox=""
}
"""
]
]
],
[$class: 'DynamicReferenceParameter',
choiceType: 'ET_FORMATTED_HTML',
omitValueField: true,
description: 'Please provide a Elastic alias label',
name: 'PC_CPU',
randomName: 'choice-parameter-5631314456178624',
referencedParameters: 'NeedUpgradePC',
script: [
$class: 'GroovyScript',
fallbackScript: [
classpath: [],
sandbox: true,
script:
'return[\'nothing.....\']'
],
script: [
classpath: [],
sandbox: true,
script:
"""
if(NeedUpgradePC.equals('yes')) {
inputBox=""
} else {
inputBox=""
}
"""
]
]
]
])