Create
cancel
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

Is there a way that if the value is ticked the text field will show using Behavior Plugin

Hello Atlassian,

Is there a way that if the "Other" value is ticked the text field will show,  instead of the below code as it is just reading what is the specific value of the selectedOption. 

The reason for this is sometimes the Impact can have 2 values (e.g Customer and Other)

Custom Field Name: Impact

Field Type: Checkbox

Options:

  • Customer
  • Client
  • Other

Custom Field Name: If Others, please specify

Field Type: Text (Multi-line)

 

Currently, this is my code and it is working perfectly.

 

import com.atlassian.jira.component.ComponentAccessor

def impact = getFieldById("customfield_23845")
def others = getFieldById("customfield_23644")
def selectedOption = impact.getValue() as String

if (selectedOption == "Others")
others.setHidden(false)

else if ((selectedOption == "Others" && "Automation/Cost saving (Efficiency)"))
others.setHidden(false)

else {
if(others.value)
{
others.setFormValue(null)
}
others.setHidden(true)
}

 

Thank you!

0 answers

Suggest an answer

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

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

116 views 1 9
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