简体   繁体   English

如何在詹金斯的另一个活动选择参数的groovy脚本中读取活动选择参数的值?

[英]how read active choices parameter value in another active chocices parameter's groovy script in jenkins?

In a Jenkins build I created two "Active Choices Reactive Reference Parameter" (input text boxes) those are PARAMETER1 and PARAMETER2. 在Jenkins构建中,我创建了两个“主动选择反应式参考参数”(输入文本框),分别是PARAMETER1和PARAMETER2。 I can use contains() call in PARAMETER2's groovy script as below 我可以在PARAMETER2的groovy脚本中使用contains()调用,如下所示

PARAMETER1.contains("some string")

but I could not find a way to read PARAMTER1's exact value. 但我找不到读取PARAMTER1确切值的方法。

I am very new ing groovy and do not have understanding of Java. 我是新手,对Java不了解。

How can I set use PARAMETER1 to a string in PARAMETER2's groovy script? 如何将PARAMETER1设置为PARAMETER2的groovy脚本中的字符串?

The PARAMETER1 variable gets injected into your PARAMETER2 Groovy script, as a variable. PARAMETER1变量作为变量注入到PARAMETER2 Groovy脚本中。

It means that you can call it just like a normal variable. 这意味着您可以像普通变量一样调用它。 For example. 例如。

return [PARAMETER1+'ou', PARAMETER1+'AA', PARAMETER1+'11', ]

That will return the value of PARAMETER1 concatenated with some other string. 这将返回与其他字符串串联的PARAMETER1的值。

Hope that helps, Bruno 希望能有所帮助,布鲁诺

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Jenkins 声明式管道:如何从“主动选择反应引用参数的 Groovy 脚本”调用函数? - Jenkins Declarative Pipeline: How to call functions from "Active choices reactive reference parameter's Groovy script"? Jenkins:从Active Choices参数groovy脚本访问其他插件 - Jenkins: Accessing other plugins from Active Choices Parameter groovy script Jenkins Groovy 和 Active Choices 反应参数 - Jenkins Groovy and Active Choices Reactive Parameter 如何使用 jenkins 主动选择参数读取目录中的所有文件名? - How to read all file names in a directory with jenkins active choices parameter? Jenkins 传递 Active Choices 参数的值 - Jenkins pass value of Active Choices Parameter Jenkins 在 groovy 脚本中检索活动选择参数 - Jenkins retrieve active choice parameter in groovy script Jenkins 主动选择插件 - 如何获取密码参数的值 - Jenkins active choices plugin - how to get value of password parameter 如何在 Jenkins 中为 Active Choices Reactive Parameter 插件设置默认值? - How to set default value for Active Choices Reactive Parameter plugin in Jenkins? Groovy 脚本在 Jenkins 活动选择参数中不起作用 - Groovy script is not working in Jenkins Active choice parameter 詹金斯:Active Choices参数+ Groovy基于REST响应对象构建列表 - Jenkins: Active Choices Parameter + Groovy to build a list based on REST responde
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM