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:
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!
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.