Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Text Field to appear based on Drop Down selection


I would like to have a text box appear based on what Priority (Jira standard field) is selected. So if Highest or High Priority is selected I need my text box (custom field) to appear. So if the Priority Is Medium, Low, or Lowest, I don't want that text box to appear. Can anyone help with this on ScriptRunner?

I have been able to accomplish this with other field types, but not drop down fields.

Thank you.

1 answer

1 accepted

0 votes
Answer accepted

This is a use case of ScriptRunner's Behaviour. It field return a Priority object.

1. Navigate: ScriptRunner > Behaviour > create and edit your Behaviour > add "Priority" field.

2. Add following server-side script:

def currentPriority = getFieldById(getFieldChanged()).getValue().name

if (currentPriority == "Hightest" || currentPriority == "High") {
getFieldByName("Your Text Field").setHidden(false).setRequired(true)
} else {
getFieldByName("Your Text Field").setHidden(true).setRequired(false)

I assume once the text field is shown, it is also required.

Above snippet will show a static type checking error, but it will work fine. To eliminate it, you need to cast currentPriority to the proper class Priority.

Thank you so much! This will work for what we need! I appreciate your help. :)

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you