Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a Jenkins build parameter to refer the ${BUILD_NUMBER} env variable

Tags:

jenkins

is it possible to refer the Jenkins ${BUILD_NUMBER} variable in the default value of a Jenkins String parameter? I can't manage to do that.

like image 723
Ducu Sultan Avatar asked Jan 25 '26 15:01

Ducu Sultan


1 Answers

Use Build Name Setter Plugin to set the custom names to build.

To achieve your requirement, use Pre-Scm-Buildstep which executes as soon as the build starts.

Here you can use Conditional BuildStep Plugin to add conditions based on build trigger cause, if manual cause you can set what ever format build name you want using Build Name Setter Plugin and similarly for other conditions.

like image 178
Suresh Avatar answered Jan 27 '26 12:01

Suresh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!