Non-Pipeline Solution with Active choice plugin.
You can get this done using the Active Choice Plugin. This supports HTML rendering. So in your case. First, let's get the Service name, and based on this we will render a text box.
First Add an Active Choice Parameter

For the Groovy script add the following content.
return ["Service01", "Service02"]
Next, add an Active Choices Reactive Reference Parameter like below.


For the groovy part add the following content.
def htmlContent = "<table><tr>"
if(services.contains("Service01")){
htmlContent = """
${htmlContent}
<tr>
<td>
<label title=\"Service01\" class=\" \">Service 01 </label>
</td>
<td>
<input type=\"text\" class=\" \" name=\"value\" value=\"version\"> </br>
</td>
</tr>
"""
}
if(services.contains("Service02")){
htmlContent = """
${htmlContent}
<tr>
<td>
<label title=\"Service02\" class=\" \">Service 02 </label>
</td>
<td>
<input type=\"text\" class=\" \" name=\"value\" value=\"version\"> </br>
</td>
</tr>
"""
}
htmlContent = "${htmlContent}</tr></table>"
return htmlContent
Make sure Referenced parameters are added. This needs to refer to the variable you used in the first parameter.
Now the pipeline execution will look like the below.

Note: Active Choice Parameter plugin does not support blue ocean UI.
With A declarative Pipeline
If you are willing to take everything to a declarative pipeline you can do something like the below.
def INPUT_1 = ""
def INPUT_2 = ""
pipeline {
agent any
stages {
stage("Get Inputs") {
steps{
timeout(time: 300, unit: 'SECONDS') {
script {
// The Initial Choice
INPUT_1 = input message: 'Please select', ok: 'Next',
parameters: [
choice(name: 'SERVICE', choices: ['Service01','Service02'], description: 'Please select')]
if(INPUT_1.equals("Service01")) {
INPUT_2 = input message: 'Please Select', ok: 'Next',
parameters: [ choice(name: 'Version', choices: ['v01','v02'], description: 'Please select')]
} else {
INPUT_2 = input message: 'Please Select', ok: 'Next',
parameters: [
choice(name: 'Version', choices: ["v1.1","v1.2","v1.3"], description: 'Select the file')]
}
echo "INPUT 1 ::: ${INPUT_1}"
echo "INPUT 2 ::: ${INPUT_2}"
}
}
}
}
}
post {
success {
echo 'The process is successfully Completed....'
}
}
}
Which results in the following.

