Show fields upon other field selection

I have 5 fields. 3 radio button fields and 2 text fields. Initially, only one field should be displayed when Create button is pressed. With the behaviours plugin and the initializer, I was able to hide the other 4 fields.

Now, when I click on the 1st radio button field, the second radio button field should be displayed. How do I achieve it? Could you please help me here?



6 answers


You can 'attach' a behaviour to your radio btn and in the serve rside script use the follow script

def radioBtn = getFieldByName("radio btn")
def description = getFieldByName("Test Hide")

if (radioBtn.getValue() == "Option1") {
} else {

Can I ask you which version of SR you use ? Because the behaviours plugin was merged to SR in a very early version.


Good Morning!!! We are using the last available free version of Script Runner. I do not know the version but I will be able to provide it to you right after I get to work. On my way to work now.








We are using 3.1.4 version of Script Runner


Looks like there is something I am doing wrong here. This is what I am performing right now:

We are using Script Runner 3.1.4 version on JIRA 6.4.12

I have the following custom fields:

  1. Requester Name (User Picker Field)
  2. Summary (Text Field)
  3. Select a Service Type (Radio Button with options Voice and Data)
  4. Select a Requirement (Radio Button with options Service, Service and Equipment, Equipment)
  5. Select an Action (Radio Button with options New, Change Existing Service, Disconnect)
  6. Purpose (Multi Text Field)


  • When the user clicks on the Create button and selects the required project, it should only show Requester Name, Summary and Select a Service Type fields. (I was able to achieve this from the Behaviours plugin)
    • Added a Behaviour named Hide Fields and clicked Add
    • Added a mapping by selecting the Issue Type and Project
    • Clicked on the Fields link and clicked on the Create Initialiser
    • Under Create Initialiser, clicked on the Edit serverside script link and added the following code


FormField selectRequirement = getFieldByName("Select a Requirement")
FormField selectAction = getFieldByName("Select an Action")
FormField enterPurpose = getFieldByName("Purpose")
    •  This allowed me to hide the fields when clicked on the Create button




  • This is where I have the problem. Now I need to display Select a Requirement field when clicking on Select a Service Type radio button options and this is not happening
    • Added another behavior named Show Requirement field and clicked Add
    • Added a mapping by selecting the Issue Type and Project
    • Clicked on the Fields link and selected the Select a Service Type field
    • For this field, I clicked on the Add serverside script and entered the following code


def selectServiceType = getFieldByName("Select a Service Type")
def selectRequirement = getFieldByName("select a Requirement")
if ((selectServiceType.getValue() == "Voice") || (selectServiceType.getValue() == "Data")) {
} else {


  • After saving the above, I click on Create button to see the fields hidden as expected and when clicked on Select a Service Type radio button options, nothing happens. I tried to put in the same code on the Select a Requirement field also, but nothing happens.

Could you please let me know what is my issue here? I would appreciate your help in this matter. 



I got this to work using Behaviours plugin. It works excellently.



The fields are displaying correctly now whenever another field is being selected. But when I click on the Create button, nothing is happening. The ticket is not getting created, What might be the issue? Could you please let me know?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

400 views 6 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you