ScriptRunner Behaviour returns unexpected value with Multiselect field
I have a multiselect field with 3 values: "Team 1", "Team 2", and "Team 3". I'm using ScriptRunner 5.4.49 to count the number of entries in the field:
def scrum = getFieldByName("Scrum Team Multi") def values = scrum.getValue() as List<Map> log.debug("----------------------> SCRUM " + values) log.debug("----------------------> SCRUM " + values.size)
When I have only one entry, the value returned is the number of characters in the value instead of 1: ----------------------> SCRUM [Team 1, Team 2] ----------------------> SCRUM 2 (Remove "Team 1") ----------------------> SCRUM [T, e, a, m, , 2] ----------------------> SCRUM 6
Do you know why this would be?
Comments (6)
-
reporter -
repo owner Can you please compare behaviour with a standard Jira multi select field? Project Specific Multi Select should behave the same, because internally there is no real difference.
-
reporter Regular Jira multiselect field works fine - counts elements properly.
-
reporter I was casting the field too early. Please close this ticket.
-
repo owner Great to hear that it is working.
Best regards, Holger
-
repo owner - changed status to resolved
- Log in to comment
Posting info again in formatted form: