Hi All,
Not sure what I'm doing wrong here... I need to write a behavior that will work in the customer portal of ServiceDesk, that will indicate if at least one value in a standard Jira Multiselect field has been chosen. I can check if any specific value has been selected using the many examples found on this forum, but my main goal here is to simply test if >=1 options have been chosen. Any suggestions?
This is as far as I have gotten, but no joy yet... :
def my_multisel= getFieldByName("multiselect1")
def crField = getFieldById(getFieldChanged())
def int selectedOptions = crField.size()
if (selectedOptions >= 1{
my_multisel.setError("at least 1 item selected") // just used to test
// do more stuff here in real life...
}
else
{my_multisel.clearError()}
Jira 7.12, Scriptrunner 5.5.9, server install
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.