how to add new line to description in Jenkins, when I change it programmatically?
I have tried something like this:
job.builds[0].description = "hello" << '\n' << "world"
and Console Scripts prints well:
hello
world
but in description on Jenkins, this job has "hello world" without newline beetwen hello
and world
Is there any way to do this?
Single-line comments in Jenkinsfile are the same as we see in popular languages like Java, C++, and C#. They start with two forward slashes (//). Any text between // and the end of the line is commented and ignored in Jenkinsfile.
Ok, I found the answer.
Description is Raw Html.
To create new line, we must write:
job.builds[0].description = "hello<br> world"
Console will print it as hello<br> world
, but in description will be newline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With