shaneoh shaneoh - 14 days ago 14
Groovy Question

Using HTML in job description for Jenkins job generated by DSL

I'm migrating some Jenkins jobs to DSL code from the current manual configurations. Some of these jobs have descriptions which contain HTML, but I can't find a way to enter this HTML in the seed job so that the generated job contains the same description. In one example, the current job has this description:

Multi-Platform Build <br/><br/>

Builds nightly but only if there has been SCM revisions against the application Core Trunk. <br/><br/>

This is being replaced by <a href="http://myjenkinsserver/view/application/job/application-new">application-multi-platform-new</a>


Which results in a nicely formatted job description with line breaks and a hyperlink as well.

I want to replicate this when I generate the same job from a DSL script but there doesn't seem to be a way to do this.

Answer

It should be possible with just specifying the html-tags that you need. What is your output?

    description("""
Multi-Platform Build <br/><br/>

Builds nightly but only if there has been SCM revisions against the application Core Trunk. <br/><br/>

This is being replaced by <a href="http://myjenkinsserver/view/application/job/application-new">application-multi-platform-new</a>
    """)