Subrat Sahoo
Subrat Sahoo

Reputation: 195

How to set a string name for pipeline build in jenkins

I am running jenkins on a linux machine. I have a pipeline job in place, so each pipeline build shows build number in general. Instead of that is it possible to give string parameter to display on the UI ? I have tried checking build parameter plugin, but in pipeline configuration i don't see option to inject the string parameter. And the documentation doesn't help.

Upvotes: 2

Views: 1770

Answers (2)

Jon S
Jon S

Reputation: 16346

You can set the build name by doing:

currentBuild.displayName = "#${currentBuild.number} Hello"

This will name the build #2 Hello for build number 2.

Upvotes: 3

Subrat Sahoo
Subrat Sahoo

Reputation: 195

For my case, i had to add a line in my pipeline groovy script

node(Slave01) {
currentBuild.displayName = "${URL_Name}"
}

${URL_Name} = here is the parameter

Upvotes: 0

Related Questions