Hi everyone, hope this question finds you in good wealth.
As per the subject above, would like to know how it is executed, as most tutorials I found, have done it after the issue is created.
And in the official documentation for getValue , getValue() only Gets the value that is current in the form.
I would like to know how to get the values of the single select dropdown custom field of an issue before the issue gets created.
Trying to achieve this in the Behaviour console area.
For example, this is the custom field with single select dropdown
FormField ffOptionsField = getFieldById("Dropdown Custom Field")In the Inspect Element, this is the structure:
<div id="qf-field-customfield_111" class="qf-field qf-field-active" style="display: block;">
<div class="field-group">
<label for="customfield_111">Dropdown Custom Field</label>
<select class="select cf-select clientreadonly" name="customfield_111" id="customfield_111" disabled="">
<option value="-1">None</option>
<option value="000">Option One</option>
<option value="111">Option Two</option>
<option value="222">Option Three</option>
</select>
</div>
</div>
Am trying to get the 'Option One' to check against another list that I have managed to get from a json file. so the function would look like this:
def getInFieldOptions(String valueFromJson){
def fieldOptionsList = ffOptionsField.getValue() // this would get null
if (valueFromJson in fieldOptionsList) {
ffOptionsField.setFormValue(valueFromJson)
} else {
ffOptionsField.setFormValue("-1")
}
}But, the code ffOptionsField.getValue() return null for me.
Any pointers would be helpful!