I defined parameter of type "Active Choices Reactive Reference Parameter" on Freestyle Job
it returns HTML text input - <input>. but after populating this data and press "Build" i can't get the user input of this text field, tried with groovy or shell steps, for the parameter name itself i get empty string.
it's possible somehow to fetch the value of below field VAPP_ID ? suppose to get "123"
This is the groovy script of this Formatted HTML:
vappHtml = '''
<ul style="list-style-type: none">
<li>
<label for="VAPP_ID">VAPP_ID</label>
<input type="text" id="VAPP_ID" name="VAPP_ID">
</li>
</ul>
'''
return vappHtml
Finally i found what is the exact input definition needed to be able to fetch the data later in build steps.
groovy script:
vappHtml = '''
<ul style="list-style-type: none">
<li style="padding: 5px">
<label>VAPP_ID</label>
<input type="text" class="setting-input" name="value">
</li>
</ul>
'''
return vappHtml
How to actually fetch the data:
in build steps, like Shell, just get the original build parameter in my case it's $Env_Details
i was missing for 2 mandatory attributes for the <input>
Note - In case you want to use multiple input fields, just give all of them the same name attribute: name="value", in the result, it will just give you all the fields values separated by "," delimiter, so you can split it in groovy or something.
Hope it will help someone :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With