Default value taken from display text instead of value

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When finding default value in Map<Object, Object> returned from script the display text is collected instead of the actual value.

       Example:

      Script returns Map<Object, Object> containing versions of software the job needs to operate on:

      ['1.0.6': '1.0.6 (latest):selected',
       '1.0.5': 'chart:1.0.5, app:1.0.5', 
       '1.0.4': 'chart:1.0.4, app:1.0.3',
       '1.0.3': 'chart:1.0.3, app:1.0.2',
       '1.0.2': 'chart:1.0.2, app:1.0.1',
       '1.0.1': 'chart:1.0.1, app:1.0.1-SNAPSHOT', 
       '1.0.0': 'chart:1.0.0, app:1.0.0-SNAPSHOT']
      

      Impact:
      If the parameter is defined inside a pipeline and the job is run for the first time the default value is expected to be 1.0.6 but instead 1.0.6 (latest) is returned back.

      Issue found here: https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290

       
      suggested fix: Use choices.keys()

      I can prepare the pull request, no problem. 

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            Pavel Fila
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: