Question: I'm trying to replace our current build pipeline, currently hacked together using old-school Jenkins jobs, with a new job that uses the Jenkins pipeline plugin, and loads a `Jenkinsfile` from the project repository.

One thing that the legacy job did was set the build description to include the Mercurial hash, username and current version using the [Description setter plugin](https://wiki.jenkins-ci.org/display/JENKINS/Project+Description+Setter+Plugin), so that builds are easy to find.

Is there a way to replicate/emulate this behaviour with the Jenkins pipeline plugin?

Answer: 
Just figured it out. The pipeline job exposes a `currentBuild` global variable with writable properties. Setting the description can be done with:

```
currentBuild.description = "my new description"

```

anywhere in the pipeline script. More information in this [DZone tutorial](https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow).
This may not have been the case when jjst wrote his answer but now with the latest jenkins and plugins you can set this outside the main pipeline at the top. This means you dont have to embed script setting and have special steps etc eg

```
currentBuild.description = "my new description"
pipeline {...

```

or

```
currentBuild.description = """
blah
blah
blah
"""
pipeline {

```