I'm going to create a cascaded select list conversions field through dynamic calls. However, the call works normally, but the value of the second field is not emptied. To empty the field, I called the same method as form2.setFormValue(") and form2.setFieldOptions([:]), but failed.
Please help me
This is XML of my behavior :
<config id="2" name="ddd" description="" disabled="false" use-validator-plugin="false">
<init validator="server">
<validator-script>
<script>getFieldByName("선택1").convertToSingleSelect([ ajaxOptions: [ url : getBaseUrl() + "/rest/scriptrunner/latest/custom/getSInfo", query: true, // keep going back to the sever for each keystroke formatResponse: "general", ] ]) </script>
<scriptPath/>
<parameters/>
</validator-script>
<validator-method>run</validator-method>
</init>
<field validator="server" id="customfield_10500" readonly="false" hidden="false" required="false" name="선택1">
<validator-script>
<script>def form = getFieldByName("선택1") def form2 = getFieldByName("선택2") def data = form.getValue() form2.setFormValue("") form2.setFieldOptions([:]) if(data != "") { data = data.toString() data = data.substring(data.indexOf("(")+1, data.indexOf(")")) } else { data = "None" } form2.convertToSingleSelect([ ajaxOptions: [ url : getBaseUrl() + "/rest/scriptrunner/latest/custom/getSInfo/${data}", query: true, // keep going back to the sever for each keystroke formatResponse: "general", ] ])</script>
<scriptPath/>
<parameters/>
</validator-script>
<validator-method>run</validator-method>
</field>
</config>
Hi @hyojoon choi ,
Unfortunately, it is not possible to clear the value of the select list conversions field currently according to Jamie's comment here: SRJIRA-2168.
There is a feature request was filed in ScriptRunner support portal here: SRJIRA-4146 for this.
You may leave a comment or/and vote on the feature request as this is regularly reviewed by the product manager and developers.
Have a nice day, and stay safe!
Kind Regards,
JJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.