How to set build name in Pipeline job

Issue

I would like to set current build name and description in a Pipeline job.
 

Environment

  • CloudBees Jenkins Enterprise
  • Pipeline

Resolution

Example:

node {
    currentBuild.displayName = "fooName"
    currentBuild.description = "fooDescription"
}

Replace ‘fooName’ and ‘fooDescription’ with your desired build name and description.

Have more questions? Submit a request

2 Comments

  • 2
    Avatar
    Anna Kordas

    Actually it changes the build description not build name, so the post title can be confusing. Resolution is currentBuild.displayName

    Edited by Anna Kordas
  • 0
    Avatar
    Ivan Fernandez Calvo

    We will update the article with the changes.

Please sign in to leave a comment.