Forums

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

How to disable scriptrunner behaviour field switches?

Roland Siegel
Contributor
October 14, 2020

Hi,

is it possible to disable the field switches at a behaviour?

I need a behaviour for a custom field (cascading select) which only fires my server-side script but I don't want the switches to do anything.Screenshot - 14.10.2020 , 14_58_36.png

This is my script:

-------------

def triggerField = getFieldByName("Produkt/Modul")
def fieldToHideOrShow = getFieldByName("advantage-Version")
def valueToCheck = triggerField.getValue() as ArrayList<String>

if (valueToCheck.get(0) == "advantage") {
  fieldToHideOrShow.setHidden(false)
  fieldToHideOrShow.setRequired(true)
}
else {
  fieldToHideOrShow.setHidden(true)
  fieldToHideOrShow.setRequired(false)
}

--------------

It works fine but I don't want the field switches because they do changes to the field "Produkt/Modul" itself.

0 answers

Suggest an answer

Log in or Sign up to answer