在Jenkins Groovy脚本的另一个参数中尝试使用参数引用时,它不会返回该值。它仍然是$ {variable},我在做什么错了?
InstanceType是一个Active Choices反应参数
<select name ="value">
<option value ="Same_Value">${InstanceType}</option>
</select>
'''
html3 = '''
<select name ="value">
<option value ="t2.medium">t2.medium</option>
<option value ="t2.large">t2.large</option>
<option value ="t2.xlarge">t2.xlarge</option>
<option value ="t2.2xlarge">t2.2xlarge</option>
<option value ="t3.medium">t3.medium</option>
<option value ="t3.large">t3.large</option>
<option value ="t3.xlarge">t3.xlarge</option>
<option value ="t3.2xlarge">t3.2xlarge</option>
</select>
'''
if (MakeChanges.contains("yes")) {
return html3 }
else { return html }
答案 0 :(得分:0)
答案是2折:
1:确保在“参考参数”框中列出了参考参数
2:确保您使用的是三重双引号而不是三重单引号