活动选择反应式参考参数在jenkins管道中为带格式的html,具有默认值

时间:2020-04-17 07:40:36

标签: jenkins jenkins-pipeline pipeline

我正在尝试在jenkins管道中创建具有默认值的Active choice HTML参数,但找不到问题。

properties([
    parameters([
        [$class: 'DynamicReferenceParameter', 
            choiceType: 'ET_FORMATTED_HTML',
            omitValueField: true,
            referencedParameters: '',
            description: 'Test', 
            name: 'TEST', 
            randomName: 'choice-parameter-46431548642', 
            script: [
                $class: 'GroovyScript', 
                fallbackScript: [
                    classpath: [], 
                    sandbox: true, 
                    script: 
                        'return[\'Could not get any info\']'
                ], 
                script: [
                    classpath: [], 
                    sandbox: false, 
                    script: 
                        '''
                        return "<input name=\\"value\\" value=\\"Test\\" class=\\"setting-input\\" type=\\"text\\">" 
                        '''
                ]
            ]
        ]
    ])
])

使用时效果很好:

return "<input name=\\"value\\" value=\\"\\" class=\\"setting-input\\" type=\\"text\\">" 

没有值,但是我得到了空字段。 有什么想法吗?

0 个答案:

没有答案