问题描述
我有一个詹金斯(Jenkins)工作,带有主动选择参数"(Active Choices Parameter)和主动选择反应参数".
I have a jenkins job with "Active Choices Parameter" and "Active Choices Reactive Parameter".
pipeline {
agent { label 'Agent_Name' }
stages {
stage('Build') {
steps {
script {
def res=build job: 'App_Build', parameters: [string(name: 'ActiveChoicesParam', value: 'Dev'),string(name: 'ActiveChoicesReactiveParam', value: 'Server1')]
}
}
}
}
}
我正在尝试调用jenkins作业并使用管道脚本传递参数值.但是,出现以下错误:
I am trying to call the jenkins job and pass parameter values using pipeline script. However, I am getting the following error:
参数"ActiveChoicesReactiveParam"的类型不符合App_Build.转换为主动选择反应参数.
The parameter 'ActiveChoicesReactiveParam' did not have the type expected byApp_Build. Converting to Active Choices Reactive Parameter.
它们(Dev和Server1)是有效值-如何传递这些值?
They (Dev and Server1) are valid values - How can I pass these values?
推荐答案
尝试设置为新的StringParameterValue的
Try setting up as new StringParameterValue's
build(job: "App_Build",
parameters: [
new StringParameterValue('ActiveChoicesParam', 'Dev'),
new StringParameterValue('ActiveChoicesReactiveParam', 'Server1')
],
)
这篇关于詹金斯传递Active Choices参数的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!