Showing/hiding fields base of value in previous field

jmarko May 29, 2020

Hi, 
I have problem with showing and hiding fields using ScriptRunner. I checked different posts here and saw different solutions but it seems like nothing works for me.  Costumer portal simply don't behave like I would wont to.
When customer choose 'Duplikat', second field 'Datum predvidenega vračila' should became visible. Otherwise it stays hidden.
Please help. What am I doing wrong.

Code:

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

def cascadingField = getFieldById(getFieldChanged())
String cascadingValues = cascadingField.getValue()

def Datum = getFieldById("customfield_12629") //Datum predvidenega vračila
Datum.setHidden(true)

if (cascadingValues == "Duplikat") {
Datum.setHidden(true)
}
else
{
Datum.setHidden(false)
}

 

Annotation 2020-05-29 115222.png

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events