Paul
Paul

Reputation: 367

How to add a hyperlink in jenkins build description using scripted pipeline

Using jenkins build description plug in I want to print a path of my network drive.

Below code is working fine.


        stage('print') {
            env.SMBuildDescription="Build path:"+"${buildpath}"
            currentBuild.description=SMBuildDescription
        }

But I want to add build path as a hyperlink.

Upvotes: 6

Views: 10535

Answers (1)

MaratC
MaratC

Reputation: 6869

Try this:

stage('print') {
            currentBuild.description = """Build path: <a href="${buildpath}">Link</a> """
        }

This will only work if Markup Formatter is set to Safe HTML (rather than Plain text) under /configureSecurity/ on your Jenkins instance.

Upvotes: 7

Related Questions