The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Ysaac James Salao
June 22, 2018

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events