jenkinspluginsparametersparameter-passingmultiline

Jenkins - Trigger/call builds on other projects - Help needed on sending multi-line String parameter


I have a 2 Jenkins job:

  1. projectA - will run periodically for latest builds and updates a text file to trigger yes. When the trigger is set to YES, it will trigger the downstream projectB with multiple kinds of parameters passed as Key=Value format
  2. projectB - has multiple parameters - including Boolean, String, Extended Choice & Multi-line parameters. projectB - Parameters page on a normal execution

So when the projectA triggers projectB, all parameters have been passed successfully. For the Multi-line parameter, only the first line value is passed & discarding all subsequent lines.

WaitTime=900
DBCheck=true
Snmpwalk=true
TcpPortScanner=false
CLI_DisplayOutput="show 1
show 2
show 3"

Upon checking the Parameters page on this triggered execution, It displays only single line text box instead of Multi line text box.

projectB - Parameters page which is triggered by projectA

P.S.

  1. Wait time might be different. Just captured random build run.
  2. Instead of getting a multi line string, the parameter was single-line string

Br, Jagan


Solution

  • Although it is very late, and many could have solved the problem. I would like to highlight what I have done during the issue occurred time.

    As explained, I used Multiline input (in Configure)

    enter image description here

    and the execution Parameter listed as below with multiple show commands (during Run)

    enter image description here

    I used another plugin to write this content as a file in my workspace during my Build Step (in Configure)

    enter image description here

    I also made sure that the content is successfully passed and file created at my execution

    enter image description here

    Now my device could read the contents one by one and executes it.