When I run a job in Jenkins, each build is given a name that shows in the UI in Build History that\'s basically the current date and time.
I\'d like to be able to put in
It is also possible to set build name "manually", using Jenkins Groovy plugin. Just follow these steps:
Next step - run a System Groovy script:
def build = Thread.currentThread().executable
assert build
def newBuildName = build.getEnvironment().get('newVersion')
try {
if (newBuildName) build.displayName = newBuildName
println "Build display name is set to ${newBuildName}"
} catch (MissingPropertyException e) {}
As you can see, we are using a build.displayName
variable here. Its value is a visible build name in Jenkins.