Parameterized job always run with default parameter

Solution 1

Currently there is not a straight forward solution to run a parameterized job with default parameter using a plugin. However there is a workaround to accomplish that using the EnvInject Plugin.

As @General_Code noted:

Just add the build step, set the variable like: var1=value and then use it using ${var1}

Solution 2

As @RejeeshChandran noted: a more robust solution is the Parameterized Build Plugin which provides the functionality of defaults values for the parameters.

Note

Note that Parameter Defaults Options is a plugin under development which will solve exactly this request. When it is released, you will be able to set it up so your parameter will get a default value when you run it manually.

Tags:

Jenkins