Can a Jenkins job set the description build upon starting the build

I am familiar with the Description Setter plugin (, but it only kicks in as a post-build action. I have some very long testing builds and I would like to set the build description right on the start – either as a pre-build or as a build step.

  • How to generate war file using jenkins Build->Execute shell option?
  • Jenkins - groovy script - get last successful build date in dd-mm-yyyy format
  • Jenkins Publish over ssh authentification failed with private key
  • how to get the BUILD_USER in Jenkins when job triggered by timer
  • How to simultaneously deploy Node.js web app on multiple servers with Jenkins?
  • Jenkins: running build does not provision docker slave
  • CasperJs + jenkins : when a test fails, how to retrieve all information on this test
  • Xamarin - Cross Platform Unit Testing
  • Running Jenkins job simultaneously on all nodes
  • On a Mac Sierra, how can I give an ssh session access to the display?
  • How do you update database when using composer/jenkins and wordpress with plugins?
  • jenkins cli with checkout Subversion using groovy script
  • 3 Solutions collect form web for “Can a Jenkins job set the description build upon starting the build”

    Use pre-scm-build step and Conditional Build Step plugins. In global configuration, find “Conditional Build step” section, and select “any builder” (or something similar). This will allow the plugin to use any build or post-build step.

    Then in the job configuration, under Build Environment, use “Run buildstep before SCM runs”, and select Conditional Build Step. Leave the condition to “always”, and select “Description Setter”.

    FWIW, in my environment with latest plugins, I can execute “Description Setter” from pre-SCM step without the need for Conditional Build step.

    Since my build is submitted from a Python script, I added a kludge in the script:
    1. Wait until it starts executing and find its build ID in the job (I can uniquely identify my build by the build parameters that were used)
    2. Having the job name and the build number, use the Jenkins CLI (jar file) to set the description.

    Admittedly, the solution proposed by Slav is more elegant, but I have not gotten around to test it…Once I do, I will report here.

    You can also add a groovy build step (which should be the first step), that will use the build parameters, like this:

    /* Get System name, version, user name */
    def system  = build.getEnvironment(listener).get('system')
    def version = build.getEnvironment(listener).get('system_version')
    def user    = build.getEnvironment(listener).get('USERNAME')
    /* Build description with params and send description to currentbuild */
    def description = "$system / $version / $user"
    Git Baby is a git and github fan, let's start git clone.