Score:0

Show parameters only if Copy scenario specified (Jenkinsfile)

mx flag

trying to create a jenkinsfile with dynamic parameters. Need to show string parameter only if Copy DEPLOY_ENV is specified. Tried to do it with Active Choice Plugin, as it is done for REGION, but didn't find a way how to do that with ability to write smth. Any ideas?

properties([parameters([
[
    $class: 'ChoiceParameter',
    choiceType: 'PT_SINGLE_SELECT',
    description: 'Scenario',
    name: 'DEPLOY_ENV',
    script: [
        $class: 'GroovyScript',
        script: [
            classpath: [],
            sandbox: true, 
            script: 
                'return["Test","Publish","Copy"]'
        ],
        fallbackScript: [
            classpath: [], 
            sandbox: true, 
            script: 
              'return[\'Could not get DEPLOY_ENV\']'
        ]
    ]
],

parameters{ string (name: 'choice1', defaultValue: '', description: 'select your choice:')

enter image description here

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.