Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65485

Default value taken from display text instead of value

      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. 

          [JENKINS-65485] Default value taken from display text instead of value

          Pavel Fila created issue -
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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}{code}
          New: 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:
          {code:java}
          ['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'}{code}
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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'}{code}
          New: 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:
          {code:java}
          ['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']
          {code}
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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']
          {code}
          New: 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:
          {code:java}
          ['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']
          {code}
          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: choices.keys()|https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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']
          {code}
          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: choices.keys()|https://github.com/jenkinsci/active-choices-plugin/blob/8eb9560476db9885bd4cd27876b2e6fc3278b01e/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L290]

           
          New: 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:
          {code:java}
          ['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']
          {code}
          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: choices.keys()

           
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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']
          {code}
          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: choices.keys()

           
          New: 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:
          {code:java}
          ['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']
          {code}
          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. 
          Pavel Fila made changes -
          Description Original: 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:
          {code:java}
          ['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']
          {code}
          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. 
          New: 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:
          {code:java}
          ['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']
          {code}
          *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. 

            kinow Bruno P. Kinoshita
            pjfila Pavel Fila
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: