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

Extra comma character append at the end when passing Reactive Reference Values to the build

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • active-choices-plugin
    • None
    • Ubuntu 14.04 x86_64
      Jenkins 2.13
      Open JDK 1.7
      Active Choices Plug-in 1.4

      I follow the reference here "https://github.com/biouno/uno-choice-plugin/wiki/Using-Uno-Choice-for-Dynamic-Input-Text-Box-Defaults" to pass Reactive Reference Values to the build.

      I have 3 Active-Choice parameters:
      1.
      refer to Selection_003.png
      Active Choices Parameter: URL_ROOT

      return [ "https://www.google.ca" ]
      

      2.
      refer to Selection_004.png
      Active Choices Reactive Parameter: SUB_PATH

      return [ "test1", "test2", "test3" ] 
      

      3.
      refer to Selection_005.png
      Active Choices Reactive Reference Parameter (Formatted HTML): COMBINED_URL

      return """<input name="value" value="${URL_ROOT}/${SUB_PATH}" class="setting-input" type="text" readonly>"""
      

      When triggering the build with parameters,
      the triggering page is displayed everything correctly.
      HTML code for Formatted HTML:

      <input class="setting-input" type="text" readonly="" value="https://www.google.ca/test2" name="value">
      

      Refer to Selection_001.png and Selection_002.png

      However,
      during the build,
      Jenkins will get an extra comma character ',' at the end.

      COMBINED_URL=https://www.google.ca/test1,
      

      Refer to Selection_006.png

      And Jenkins parameter page also confirm an extra comma character at the end.
      Refer to Selection_007.png

        1. Selection_001.png
          Selection_001.png
          16 kB
        2. Selection_002.png
          Selection_002.png
          22 kB
        3. Selection_003.png
          Selection_003.png
          25 kB
        4. Selection_004.png
          Selection_004.png
          27 kB
        5. Selection_005.png
          Selection_005.png
          32 kB
        6. Selection_006.png
          Selection_006.png
          37 kB
        7. Selection_007.png
          Selection_007.png
          11 kB

          [JENKINS-36806] Extra comma character append at the end when passing Reactive Reference Values to the build

          Hi totoroliu, excellent work with the attachments. Makes it way easier to understand and reproduce the issue.

          Before I try to set up your job in my development environment, could you check that on your HTML formatted field (Selection_005.png), under Advanced, you have "Omit value field" checked?

          By default Jenkins will attach a value field. So you will end up with two value fields on your screen, and when you submit the form, Jenkins will join your desired values, with an empty string, and thus your extra comma.

          Hope that helps,
          Bruno

          Bruno P. Kinoshita added a comment - Hi totoroliu , excellent work with the attachments. Makes it way easier to understand and reproduce the issue. Before I try to set up your job in my development environment, could you check that on your HTML formatted field (Selection_005.png), under Advanced, you have "Omit value field" checked? By default Jenkins will attach a value field. So you will end up with two value fields on your screen, and when you submit the form, Jenkins will join your desired values, with an empty string, and thus your extra comma. Hope that helps, Bruno

          Rick Liu added a comment -

          Thank you for the hint~

          Check "Omit value field" fixed this comma problem.

          Thank you again.

          Rick Liu added a comment - Thank you for the hint~ Check " Omit value field " fixed this comma problem. Thank you again.

          Not a problem. We should fix the Wiki and add a mention to that as well

          Thanks for updating the ticket.

          Bruno

          Bruno P. Kinoshita added a comment - Not a problem. We should fix the Wiki and add a mention to that as well Thanks for updating the ticket. Bruno

          Not an issue

          Bruno P. Kinoshita added a comment - Not an issue

            kinow Bruno P. Kinoshita
            totoroliu Rick Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: