Alex Rivera | Logout

Jenkins Dynamic parameters based on previously selected parameter value

Asked 2013-03-27T07:38:46.843
27

Here I am basically looking for a dependency parameter.

Let's say I have two dropdowns in the build parameter section. Based on the value selected from the first dropdown the possible default I want the values of the second dropdown to vary.

Is there any plugin or approach to handle this requirement effectively?

Edit
Report

1 Answer

1

This is what you want to achieve right?

Then you could inherit hudson.model.ChoiceParameterDefinition, and override its method of getChoicesText. return the options based on whatever you want, in your situation, you could get environments from Hudson.getInstance().

Below snippets is shown how get environment variable.

Hudson.getInstance().getGlobalNodeProperties()
       .get(EnvironmentVariablesNodeProperty.class).getEnvVars().get(name);

Here is the similar question.

answered 2013-03-27T07:58:08.617

Your Answer