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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Servicedesk Scriptrunner behaviour when using a multiselect field

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

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events