Given:
The external web service that has an endpoind /info
.
GET request returns JSON like this:
In a Jenkins job when it’s triggered we need to get the value of the version
and dynamically set it as a parameter VERSION for the build.
Jenkins Extended Choice Parameter
Make the Jenkins job parameterized by checking This project is parameterized.
Add Extended Choice Parameter and set that as shown below
Groovy Script
This is the Groovy Script from the picture
Now you can use the parameter VERSION
just like this ${VERSION}
You may also find these posts interesting: