Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,508
Community Members
 
Community Events
165
Community Groups

Other field is not visible

I'm using the scriptrunner to Create a Select List With Other behaviour.

The idea was to select "other" in the prevoiusly created custom field and the script should have populate the single line text field custom field.

 

def otherFaveField = getFieldByName("Favourite Fruit (Other)")

def faveFruitField = getFieldById(getFieldChanged())

def selectedOption = faveFruitField.getValue() as String

def isOtherSelected = selectedOption == "Other"

otherFaveField.setHidden(!isOtherSelected)

otherFaveField.setRequired(isOtherSelected)

 

When I create the behaviour and add the mapping the Favorite Fruit (Other) single line text field does not appear. Any ideas ?

The documentation what I'm trying to achieve here.

Thanks

1 answer

1 accepted

The script should work fine.

The steps to reproduce is as followed:

1. You should have a custom select list field named "Favourite Fruit", with some options including "Other". Another custom text field named "Favourite Fruit (Other)".

2. Both fields are configured to show on the screens. You use Behaviour to hide them as needed.

3. Navigate ScriptRunner > Behaviours > create a behaviour > edit > add mapping to your project.

4. Add field: choose "Favourite Fruit" > add server side script > use the script.

I hope this helps!

Thanks it worked.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

320 views 0 10
Join discussion

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