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

return value separator as optional argument

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • active-choices-plugin
    • None

      It would be useful to be able to choose the separator used in the value returned by the parameter.

      In the case of a parameter where multi-selection is possible (e.g. Check Boxes), the returned value is a String enumerating all the options selected by the user, separated by a comma.

      I can think of at least one use case where it would be useful to be able to choose another separator.
      I'm working on several Jobs where the labels assigned to Jenkins nodes are listed in the Parameter. The parameter value is given as an argument to the step node to determine on which node the Job will be executed. The operator used to combine labels is &&. The current usage, where the parameter is named "labels", is as follows:

      node(labels.replace(',', ' && ') {
          stage('stageA') { ... }
          ...
      }
      

      If we could choose && as the separator, we wouldn't have to use the replace method every time.

            kinow Bruno P. Kinoshita
            rfauvel Robin Fauvel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: