How to hide and show a field based on the values of another field

Neethu Jose February 17, 2016

i want to hide and show a field based on the values of another field,how can i achieve the same? 

4 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 17, 2016

The best way to do it is use Behaviours functions in the Script Runner add-on.  If you don't do it that way, then you're in to hacking your own javascript, which is a nightmare to make work in all places and maintain during upgrades.

Brianna Barnes June 15, 2018

@Nic Brough -Adaptavist-I am trying to achieve this same thing, but we are on Jira Cloud which I've read doesn't support this. Can you suggest another way of achieving this?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2018

There is no way to do it on Cloud, that I know of.  It doesn't support the addition of the code you would need.

0 votes
Ashish Bijlwan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2021

Hi @Neethu Jose 

You can use Behavior in Jira Data Center and Server and apply the below code on the server side.

Step 1. Add Field based on which you want to Hide another field. Here I added the "Base Location" field, it's a single select field

Step 2. Add below code in server side script

Step 3. Save 

def selectlist = getFieldByName("Base Location")
def OtherBL = getFieldByName("If Other, Base Location")

def selectValue = selectlist.getValue()


if (selectValue == 'Other')
{
OtherBL.setHidden(false)
}
else
{
OtherBL.setHidden(true)
}

0 votes
TestBSA February 19, 2016

Hello - I'm assuming that we can't use Dynamic Forms on cloud version?

0 votes
Daniel Bajrak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2016

Hi,

On marketplace there is plugin called Dynamic Forms. You can show/hide fields, customfields or even all tabs based on value in select, multiselect, checkboxes or radiobuttons. Here you can find documentation: https://intenso.atlassian.net/wiki/display/DF/Dynamic%20Forms%20Home

 

I hope I've helped you

Best Regards,

Suggest an answer

Log in or Sign up to answer