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.
Comments
6 comments
Actually it changes the build description not build name, so the post title can be confusing. Resolution is currentBuild.displayName
We will update the article with the changes.
What is the equivalent for this in a declarative pipeline?
Hernán
In declarative you must use the script { ... } block.
@Hernan & @Allan that does not work in declarative pipeline.
I also tried
@Badal My script is missing the `agent` directive, the following should work as is:
If it does not, please file a support request so that we can troubleshoot this further.
Note:
currentBuild
is a Groovy variable, not an environment variable. So you cannot useenv.
Please sign in to leave a comment.