If you want to set the build description for a Jenkins job, then follow the below steps.
1. Make sure that the “Description Setter Plugin” installed on the Jenkins server.
2. Go to your Jenkins job configuration page.
3. Go to Post-Build Actions section.
4. On the “Set the build description” section, provide the regular expression to look for it and also the regular expression for failed builds.
Refer the below snippet from my Jenkins job.
I have given the regex as “project tag number is (\d*)”. So Jenkins will look for this string in my job console output and retrieve the number and use that value as build description. If in case, the job is failed, then it will use “failed” text as the build description.
My Jenkins job sample console output is as given below,
.... .... .... Project has been built successfully. project tag number is 20180330 job finished Date: Fri Mar 30 03:22:13 EDT 2018 [description-setter] Description set: 20180323 ....
The build history looks like below,