有效选择反应式参考参数无法将值从文本框传递到作业

时间:2020-03-11 15:54:55

标签: jenkins jenkins-pipeline jenkins-plugins choicefield

好,这是东西。因此,我将使用主动选择参数和主动选择反应参考参数来选择2个选项,并以此为依据,您可以运行Job或拥有一个新选项来插入一些文本然后运行job。我是这样做的:

enter image description here

enter image description here

enter image description here

enter image description here

问题是我无法使其对我在ID-1和ID-2中输入的文本有效,并作为参数传递给作业。

这是我的简单流水线:

node {


       def commit = params.value1
       def commit2 = params.value2


       stage ('Pulling code from Bitbucket') {


        git branch: 'master',
                credentialsId: '2bbc73c4-254e-45bd-85f4-6a169699310c',
                url: 'git@bitbucket.org:repo/test.git'


              sh (""" echo ${commit}""")
              sh (""" echo ${commit2}""")


        }

And Im getting: 

enter image description here

那么如何将插入文本框中的文本传递给作业?

我尝试过:

def commit = params.value1
def commit2 = params.value2

还有

def commit = params.ID-1
def commit2 = params.ID-2

如果选择“无值”,还有摆脱ID-1和ID-2选项的方法吗?

谢谢你!

0 个答案:

没有答案