Forums

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

How show fields base on drop down value?

Shah Baloch
Contributor
January 7, 2022

I created a database picker field that has a value from one of the columns from the customer table in the database. I have multiple custom fields that I want to make hidden. The only time it should display those fields is if the user selects a value from the DB Picker field.

I would like to have those fields hidden all the time but whenever the user selects a value then those fields should be visible. I mean when it's empty fields should be hidden when there is a value then fields should be visible. I tried a behaviour script but it didn't display fields. Not sure what I'm doing wrong.

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

def locationName = getFieldById('customfield_15401')
def cusName = getFieldById('customfield_18502')


cusName.setHidden(true)
if(locationName.value == ' ') {
cusName.setHidden(true)
}
else {
nameField.setHidden(false)
}

Thank you for your help

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events