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

Multiline text parameter displays as single line

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Linux

      To reproduce this problem, you need to do three things:
      1) Setup a build with a "Text parameter"
      2) Type in a multiline text when launching the build
      3) Display the parameters for the job

      The multiline text is collapsed into a single line. See attached.

      I need to preserve the multiline when displaying. How can this be fixed?

          [JENKINS-13916] Multiline text parameter displays as single line

          Hans Schulz added a comment -

          Reopening this issue since it is not completely fixed. When rebuilding, lines are still collapsed.

          Hans Schulz added a comment - Reopening this issue since it is not completely fixed. When rebuilding, lines are still collapsed.

          Hans Schulz added a comment -

          Just updated to Jenkins 2.45, issue is fixed now, also when rebuilding. Ill close it again...

          Hans Schulz added a comment - Just updated to Jenkins 2.45, issue is fixed now, also when rebuilding. Ill close it again...

          Chris Ryan added a comment -

          Hello,

          We are also seeing this behavior on Jenkins ver. 2.89.4, running on a Red Hat Enterprise Linux 7.4 host.

          We have a standard Jenkins Pipeline job, which contains a Multi-line String Parameter (it is the second of two parameters, the first being a String Parameter). When first clicking "Build with Parameters", the Multi-line parameter appropriately appears as a multi-line textarea box. This job is triggered by a CI bus message event automatically, so this field is normally auto-populated by the CI message, containing multiple lines of information.

          However, when a completed (Failed or Successful) job is rerun using "Rebuild" (either clicking on the "Rebuild" link next to the job number on the main job page, or visiting (<jenkins_url>/job/<job_name>/<job_number>/rebuild/parameterized), the same parameter is displayed as a single-line input box. If we continue with this Rebuild process, the job will fail, as the parameter is now condensed into one line. If we click "Rebuild"  from this new failed secondary job (say, #2), the parameter appropriately appears again as a textarea. This is consistently repeatable.

          The screenshots at the top of this issue are consistent with the behavior we are seeing, but we are also happy to provide additional screenshots, or browser inspector code/console output. We were not able to see anything in the Jenkins logs that are related to this issue, but we could very well be missing something.

          Any help would be greatly appreciated. Thank you!

          Chris Ryan added a comment - Hello, We are also seeing this behavior on Jenkins ver. 2.89.4, running on a Red Hat Enterprise Linux 7.4 host. We have a standard Jenkins Pipeline job, which contains a Multi-line String Parameter (it is the second of two parameters, the first being a String Parameter). When first clicking "Build with Parameters", the Multi-line parameter appropriately appears as a multi-line textarea box. This job is triggered by a CI bus message event automatically, so this field is normally auto-populated by the CI message, containing multiple lines of information. However, when a completed (Failed or Successful) job is rerun using "Rebuild" (either clicking on the "Rebuild" link next to the job number on the main job page, or visiting (<jenkins_url>/job/<job_name>/<job_number>/rebuild/parameterized), the same parameter is displayed as a single-line input box. If we continue with this Rebuild process, the job will fail, as the parameter is now condensed into one line. If we click "Rebuild"  from this new failed secondary job (say, #2), the parameter appropriately appears again as a textarea. This is consistently repeatable. The screenshots at the top of this issue are consistent with the behavior we are seeing, but we are also happy to provide additional screenshots, or browser inspector code/console output. We were not able to see anything in the Jenkins logs that are related to this issue, but we could very well be missing something. Any help would be greatly appreciated. Thank you!

          Peter MacNeil added a comment - - edited

          We are having this same experience in promotions with the Multi-Line String Parameter. Before the first execution of the promotion a multi-line  field is displayed and multi-line values can be inputted and captured by our scripting.

          As soon as the promotion runs the multi-line field is replaced by a single line field with our multi-line data all on one line.

          Clicking "Re-execute promotion" and all lines of the string value are all on one line. The multi-Lines have been lost.

          We are running Jenkins 2.150.2.

          We would greatly appreciate a solution to this so we can use a Multi-Line string input.

          Thank you All!

          Peter MacNeil added a comment - - edited We are having this same experience in promotions with the Multi-Line String Parameter. Before the first execution of the promotion a multi-line  field is displayed and multi-line values can be inputted and captured by our scripting. As soon as the promotion runs the multi-line field is replaced by a single line field with our multi-line data all on one line. Clicking "Re-execute promotion" and all lines of the string value are all on one line. The multi-Lines have been lost. We are running Jenkins 2.150.2. We would greatly appreciate a solution to this so we can use a Multi-Line string input. Thank you All!

          That issue has been reproduced with Jenkins 2.138.2 version.

          Symptom is same with pmacneil_symitar

          it is displayed as a multi-line at first execute promotion time,

          but after than (Re-execute promotion), it has been displayed as a single line parameter.

           

          Reagards,

          Francis

          Hwang Jae-young added a comment - That issue has been reproduced with Jenkins 2.138.2 version. Symptom is same with  pmacneil_symitar it is displayed as a multi-line at first execute promotion time, but after than (Re-execute promotion), it has been displayed as a single line parameter.   Reagards, Francis

          annie chang added a comment -

          issues seen from 2.150.1

          new line was removed from a Multi-Line string parameter if the job is triggered via a scheduler. ( therefor, we can not re-submit the job if the job is triggered by scheduler

          new line was perserved if the job is triggered with a manual submission

           

          annie chang added a comment - issues seen from 2.150.1 new line was removed from a Multi-Line string parameter if the job is triggered via a scheduler. ( therefor, we can not re-submit the job if the job is triggered by scheduler new line was perserved if the job is triggered with a manual submission  

          Peter MacNeil added a comment -

          That's interesting Annie and different from what I saw.
          My experience with 2.150.2 was all with manual promotions. Only the first promotion has the new lines intact.
          In all subsequent promotions (Re-execute promotion) the multi-line field is displayed as a single line field and new lines have been lost.

           

          All the best,

          Pete

          Peter MacNeil added a comment - That's interesting Annie and different from what I saw. My experience with 2.150.2 was all with manual promotions. Only the first promotion has the new lines intact. In all subsequent promotions (Re-execute promotion) the multi-line field is displayed as a single line field and new lines have been lost.   All the best, Pete

          Jarrett B added a comment -

          Hello,

          Issue still exists in 2.204.5.  Is this still being worked on?  

          Thanks

          Jarrett B added a comment - Hello, Issue still exists in 2.204.5.  Is this still being worked on?   Thanks

          sandeep gupta added a comment -

          This issue is still there in Jenkins 2.319.1. Is there any solution for this yet?

          sandeep gupta added a comment - This issue is still there in Jenkins 2.319.1. Is there any solution for this yet?

          When calling the downstream build, using the `text` parameter type not a `string`. That is, if child job has a multi-line parameter, the parent will need to call it like following:

           build job: 'child-job', parameters: [text(name: 'paramName', value: 'value1\nvalue2')]

          If you call the downstream build with parameter type `string` instead, it will show up as a single line. So below is wrong

           build job: 'child-job', parameters: [string(name: 'paramName', value: 'value1\nvalue2')]

           

          Mahmoud Al-Ashi added a comment - When calling the downstream build, using the `text` parameter type not a `string`. That is, if child job has a multi-line parameter, the parent will need to call it like following: build job: 'child-job' , parameters: [text(name: 'paramName' , value: 'value1\nvalue2' )] If you call the downstream build with parameter type `string` instead, it will show up as a single line. So below is wrong build job: 'child-job' , parameters: [string(name: 'paramName' , value: 'value1\nvalue2' )]  

            rtorre Rafa de la Torre
            deepchip Martin d'Anjou
            Votes:
            13 Vote for this issue
            Watchers:
            26 Start watching this issue

              Created:
              Updated: