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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Multi Select Drop Down Field with "Other" value selection

I have a requirement of making text field hide/unhide when value "Other" is selected on an multi select custom field.

My field "Field A" is a multi-select field with options A,B,C,Other. First I converted this field into multi select dropdown from check-box type by using below line in initializer (Behaviors).

getFieldByName("Field A").convertToMultiSelect()

After that, I used the below code in server-side script by adding a field. There are no errors.

import com.atlassian.jira.component.ComponentAccessor

// Get a pointer to my custom fields
def multisSelectList = getFieldByName("Field A")
def textField = getFieldByName("Other")

// Get the Value of My Select Field
def selectVal = multisSelectList.getValue()

// If the first option is selected in the multi select list then make the text field required.
if(selectVal.toString().contains("Other")){
textField.setHidden(false) // Make text field required
}else{
textField.setHidden(true) // Make text field optional
}

But when I

1. select only "Other" value in Field A, text field appears BUT after selecting Other value and then remove it, the text field still appears.
2. first select values A/B/C and then select "Other", text field appears. Again when I remove "Other" value after selecting it, it won't hide.

And none of the above scenarios are applicable if do not convert the field from checkbox multi select to dropdown multi select. The field behavior is perfect. 

Any help appreciated

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Bitbucket Smart Commits vs. Genius Commits - What's the difference?

If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...

106 views 0 2
Read article

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