Skip to content

Fixed CascadeChoiceParameter with RADIO choice type both in classic UI and new job page#942

Open
Eyepatch5263 wants to merge 1 commit into
jenkinsci:masterfrom
Eyepatch5263:fixes/cascadeChoiceParameter
Open

Fixed CascadeChoiceParameter with RADIO choice type both in classic UI and new job page#942
Eyepatch5263 wants to merge 1 commit into
jenkinsci:masterfrom
Eyepatch5263:fixes/cascadeChoiceParameter

Conversation

@Eyepatch5263
Copy link
Copy Markdown

@Eyepatch5263 Eyepatch5263 commented Mar 6, 2026

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

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@Eyepatch5263 Eyepatch5263 requested a review from a team as a code owner March 6, 2026 16:10
@Eyepatch5263
Copy link
Copy Markdown
Author

Screencast.From.2026-03-06.20-50-50.mp4

Testing reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant