Fixed CascadeChoiceParameter with RADIO choice type both in classic UI and new job page#942
Open
Eyepatch5263 wants to merge 1 commit into
Open
Conversation
Author
Screencast.From.2026-03-06.20-50-50.mp4Testing reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed the issue #929 cascadeChoiceParameter with radio choice type bug which was occurring when we are doing a freeStyle job with choice and active choice reactive parameter.
Testing done
Created a Freestyle Job with name: test-groovy-script-radio-bug-repro
added first parameter as choice type with
Name: ENVIRONMENT
Choices:
development
staging
production
and second Parameter of type Active Choices Reactive Parameter with
Name: CONFIG_FILE
Choice Type: Radio Buttons
Referenced parameters: ENVIRONMENT and also add a Groovy Script:
if (ENVIRONMENT.equals("development")) {
return ["dev-config-1.yaml", "dev-config-2.yaml", "dev-config-3.yaml"]
}
else if (ENVIRONMENT.equals("staging")) {
return ["staging-config-1.yaml", "staging-config-2.yaml"]
}
else if (ENVIRONMENT.equals("production")) {
return ["prod-config-1.yaml", "prod-config-2.yaml", "prod-config-3.yaml"]
}
else {
return ["default-config.yaml"]
}
add a Fallback Script:
return ["fallback-config.yaml"]
and in the build step select execute shell with the script:
echo "ENVIRONMENT = $ENVIRONMENT"
echo "CONFIG_FILE = $CONFIG_FILE"
if [ -z "$CONFIG_FILE" ]; then
echo "BUG: CONFIG_FILE is empty"
exit 1
else
echo "CONFIG_FILE selected: $CONFIG_FILE"
fi
Saved the job and build with parameters and check the console output
Earlier:
ENVIRONMENT = development
CONFIG_FILE =
BUG: CONFIG_FILE is empty
After fix applied:
ENVIRONMENT = development(selected env)
CONFIG_FILE = dev-config-1.yaml (selected option)
Submitter checklist