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

Text Parameter input field displayed as single string

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • jenkins 2.176.3
      pipeline-stage-view 2.12

      We use TextParameterDefinition to obtain a commit message for the deployment stage. The following code is used to obtain the message

        

      stage ('Approval (Dev)') {
                  milestone 1
                  
                  timeout(time:5, unit:'DAYS') {
                      commitMessage = input (id: 'userInput', message: "Approve build for Dev?", parameters: [
           				[$class: 'TextParameterDefinition', defaultValue: """${commitMessage}""", description: 'Change Summary', name: 'comment'],
                      	])
                  }
                  milestone 2
      
                  deploymentApproved = true
              }
      

       

      TextParameterDefinition is supposed to produce a multi-line input field, but instead, single-line text input is shown - resulting in all newline characters being ignored and the entire commit message being "smushed" into a single line:

      Note that the same field is shown correctly in Blue Ocean UI:

       

          [JENKINS-60160] Text Parameter input field displayed as single string

          Ping?

          Michael Kostukov added a comment - Ping?

          Alex Taylor added a comment - - edited

          This is not actually caused by stage view as you can see on the screenshot I provided. I ran with the following code:

          ```
          node(){
          stage ("step 1")

          { echo "hello" input message: 'INPUT', parameters: [string(defaultValue: """TESTING TESTING2""", description: '', name: 'FAKE', trim: false)] }

          stage ("step 2")

          { echo "hello2" }

          }
          ```

          And you can clearly it is rendered the same by stage view as it is by Jenkins itself which means this is either a pipeline issue or a core issue (I am not sure who generates that page and reads the script). Additionally this is listed as "Major" but does not appear to be blocking anything. I am having trouble understanding how this would be considered major. Would it be possible to elaborate on what functionality this is breaking?

          I think the issue is with this line: https://github.com/jenkinsci/pipeline-input-step-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution/index.jelly#L10

          The jelly just does not accept newline characters by default and I believe stage view just steals that code

          Alex Taylor added a comment - - edited This is not actually caused by stage view as you can see on the screenshot I provided. I ran with the following code: ``` node(){ stage ("step 1") { echo "hello" input message: 'INPUT', parameters: [string(defaultValue: """TESTING TESTING2""", description: '', name: 'FAKE', trim: false)] } stage ("step 2") { echo "hello2" } } ``` And you can clearly it is rendered the same by stage view as it is by Jenkins itself which means this is either a pipeline issue or a core issue (I am not sure who generates that page and reads the script). Additionally this is listed as "Major" but does not appear to be blocking anything. I am having trouble understanding how this would be considered major. Would it be possible to elaborate on what functionality this is breaking? I think the issue is with this line: https://github.com/jenkinsci/pipeline-input-step-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution/index.jelly#L10 The jelly just does not accept newline characters by default and I believe stage view just steals that code

            Unassigned Unassigned
            r0ll1ngst0ne Michael Kostukov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: