Retrieving active choice reactive variables using scripts from SVN

I have a pipeline with which display Env choice values based on the selected TASK

I am facing challenges with the following requirement. Can someone help me out.

Now the static ENV values need to be populated from the scripts and should be displayed based on the TASK user selected.

Example requirement:

choice(choices: [’ ‘, ‘REBASE’, ‘CA_REBASE_ONLY’, ‘NG_REBASE_ONLY’], description: ‘Select the task type’, name: ‘Task’),
[$class: ‘CascadeChoiceParameter’, choiceType: ‘PT_SINGLE_SELECT’, description: ‘Select Environment Name from the list’, name: ‘Env’, referencedParameters: ‘Task’, script: [$class: ‘GroovyScript’, script: [sandbox: false, script: ‘’’
if (Task == ‘REBASE’) {
./ **
** return <Values should return dynamically based on script1 output(f0dev f2dev f3dev 4dev f5dev)

} else if (Task == ‘CA_REBASE_ONLY’) {
} else if (Task == ‘NG_REBASE_ONLY’) {
return }
string(defaultValue: ‘’, description: ‘Enter the CoreAdmin revison’, trim: true, name: ‘CoreAdmin_Revision’),
string(defaultValue: ‘’, description: ‘Enter the Nextgen revison’, trim: true, name: ‘Nextgen_Revision’),
string(defaultValue: ‘’, description: ‘Enter additional email notification list seperated by comma’, trim: true, name: ‘Email_List’)