Search code examples
groovyjenkins

How to add new line to description in Jenkins


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?


Solution

  • 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.