ScriptRunner Behaviour returns unexpected value with Multiselect field

Issue #79 resolved
Joe Mallon created an issue

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)

  1. Joe Mallon reporter

    Posting info again in formatted form:

    def scrum = getFieldByName("Scrum Team Multi")
    def values = scrum.getValue() as List<Map>
    log.debug("----------------------> SCRUM " + values)
    log.debug("----------------------> SCRUM " + values.size)
    
    
    ----------------------> SCRUM [Team 1, Team 2]
    ----------------------> SCRUM 2
    (Remove "Team 1")
    ----------------------> SCRUM [T, e, a, m,  , 2]
    ----------------------> SCRUM 6
    
  2. Holger Schimanski 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.

  3. Log in to comment