Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add new line to description in Jenkins

Tags:

jenkins

groovy

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?

like image 903
Ojmeny Avatar asked May 12 '15 10:05

Ojmeny


People also ask

How do I comment out a line in Jenkins?

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.


1 Answers

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.

like image 175
Ojmeny Avatar answered Nov 16 '22 01:11

Ojmeny