Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to empty the select list conversions field?

hyojoon choi August 24, 2021

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>

1 answer

0 votes
hyojoon choi August 24, 2021

before:

1.PNG

after:

222.PNG

i want:

333333.PNG

 

please help me

Jia Jie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2021

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

Like hyojoon choi likes this

Suggest an answer

Log in or Sign up to answer