The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I have a simple behavior to clear the value of a selection field when the user selects No in another field, and the behavior does not work in the JSD portal. In the Jira UI works perfect (the selection list field value is cleared when the user selects No in another field), but in JSD portal just does not work. I have the proper mappings, so I have no clue why it does not work in JSD portal. Here is the server side script:
def SelectionListField = getFieldByName("List A")
def YesNoField = getFieldById(getFieldChanged())
def selectedOption = YesNoField.getValue() as String
def isYesSelected = selectedOption == "Yes"
SelectionListField.setHidden(! isYesSelected)
SelectionListField.setRequired(isYesSelected)
//clear SelectionListField value when YesNoField is No
if (!isYesSelected){
SelectionListField.setFormValue("")
}
I also tried this but it did not work:
SelectionListField.setFormValue(null)
And also tried this but it did not work either:
def optionsMap = ["-1": "None"]
SelectionListField.setFieldOptions(optionsMap)
As I said, in JIRA UI works fine but not in JSD portal.
Any ideas?
Thank you
Hi,
Try: getFieldByName("List A").setFormValue(-1)
Cheers,
Marina
Hi Tomas,
tty this, it works fine:
myFormField.setFormValue(["-1", "None"])
Cheers,
Andi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity. Atlassian:...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.