如何从一个主动选择无功参数引用到另一主动选择无功参数?

问题描述 投票:0回答:1

在上图中,我使用主动选择参数来选择团队。使用主动选择反应参数我使用“团队”作为参考参数来获取用例的主动选择。同样,我想使用主动选择反应参数来根据所选用例选择蓝图。是否有一种方法可以从一个主动选择无功参数到另一个选择无功参数?

jenkins jenkins-pipeline jenkins-plugins devops
1个回答
0
投票

看起来你可以使用

CascadeChoiceParameter
,就像这样:

[
        $class: 'CascadeChoiceParameter',
        choiceType: 'PT_SINGLE_SELECT',
        description: 'Blueprint',
        name: 'Blueprint',
        omitValueField: true,
        filterLength: 1,
        filterable: false,
        referencedParameters: 'UseCase',
        randomName: "choice-parameter-${randomNumber}",
        script: [
            $class: 'GroovyScript',
            fallbackScript: [
                classpath: [],
                sandbox: true,
                script: """return [Error]"""
            ],
            script: [
                classpath: [],
                sandbox: true,
                script: """
                    if () { return [bla] }
                    """
            ]
        ]
    ]
© www.soinside.com 2019 - 2024. All rights reserved.