Hi All,
I'm trying to put together a behaviour in scriptrunner, I'm pretty new to creating these so please bare with me.
In a nutshell, I have a custom field (State) when a value is selected (i.e. CA), I would need that particular custom field to display on screen (i.e. County CA). This is what I've put together so far, but I haven't had any success displaying the field when i select an option.
initialiser
def State = getFieldByName("State")
field
import com.atlassian.jira.component.ComponentAccessor
def State = getFieldByName("State")
//County List
def CountyCA = getFieldById("customfield_18914")
def CountyAL = getFieldById("customfield_18910")
def CountyAK = getFieldById("customfield_18911")
def CountyAR = getFieldById("customfield_18913")
def CountyAZ = getFieldById("customfield_18912")
CountyCA.setHidden(true)
CountyAL.setHidden(true)
CountyAK.setHidden(true)
CountyAR.setHidden(true)
CountyAZ.setHidden(true)
if (State == "CA")
{
//Show Fields
CountyCA.setHidden(false)
//Hide Fields
CountyAL.setHidden(true)
CountyAK.setHidden(true)
CountyAR.setHidden(true)
CountyAZ.setHidden(true)
}
Any suggestions on where I can go from here?
Thanks,
Norm