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

Text Parameter input field displayed as single string

    Details

    • Similar Issues:

      Description

      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:

       

        Attachments

          Activity

          Hide
          r0ll1ngst0ne Michael Kostukov added a comment -

          Ping?

          Show
          r0ll1ngst0ne Michael Kostukov added a comment - Ping?
          Hide
          ataylor 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

          Show
          ataylor 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

            People

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

              Dates

              • Created:
                Updated: