How to echo value enter by user in "formatted HTML" in Active Choice Reactive Reference Parameter in Jenkins Pipeline

huangapple go评论52阅读模式
英文:

How to echo value enter by user in "formatted HTML" in Active Choice Reactive Reference Parameter in Jenkins Pipeline

问题

我有一个名为“Active Choice Reactive Reference Parameter”的选择类型为“Formatted HTML”的参数,grove脚本如下。
名称:FA

if{!PATCH.equals("Verify")}
return "<input name='FA' value='' class='setting-input' type='text'>"
}

我的流水线脚本将是。

echo "${params.FA}"

它打印出空值。

是否有任何方法在流水线中使用这些值。

英文:

I have "Active Choice Reactive Reference Parameter" with choice type "Formatted HTML" and grove script as below.
Name : FA

if{!PATCH.equals(&quot;Verify&quot;)}
return &quot;&lt;input name=&#39;FA&#39; value =&#39;&#39; class=&#39;setting-input&#39; type=&#39;text&#39;&gt;&quot;
}

My pipeline script will be.

echo &quot;${params.FA}&quot;

it's printing the null value.

Is there any way to use these values in pipeline.

答案1

得分: 2

尝试这个:

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

在管道中打印变量如下:

print(params.FA)

记住<input>元素的2个必需属性

name='value'class='setting-input'

英文:

Try this:

return &quot;&lt;input name=&#39;value&#39; value =&#39;&#39; class=&#39;setting-input&#39; type=&#39;text&#39;&gt;&quot;

In pipeline print the variable like:

print(params.FA)

Remember 2 mandatory attributes for the &lt;input&gt;

name='value' and class='setting-input'

huangapple
  • 本文由 发表于 2023年6月5日 16:11:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76404569.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定