I have a freestyle job having several parameters.
So the user is able to enter data into the presented fields
(eg string parameter)
It seems that the GUI presented before the user presses “Build” is very limited.
I have several requirements so that the data entered by the user is validated and/or changed when starting the build.
- Make sure the string is uppercase. If that is not the case convert the data to uppercase (when leaving field or at start of the build)
- When one parameter is filled in (field 1 in GUI) and also another parameter is filled in (field 2 in GUI), make one of them empty (string = “”).
It seems the pre-build phase of a Jenkins job is very limited.
So then I tried to put all the validation and changing of parameters into the first build step.
But also his seems to be hard. Using a build step to check values is not a problem. But to change the values is not working. Having read info it seems that a build step has its own scope and changing parameters there will not change the actual parameter value which is defined in the job so that subsequent build steps take that changed value.
My first question is:
Is there a plugin or some kind of neat way to validate and change parameters before the actual starting of the build?
I tried plugin “Validating String Parameter”. But that one only validates and will not change the value in a predefined way (for instance to force uppercase)
Also it is not possible to check the value of another parameter and h=behave accordingly.
What is the best way to implement such a first build step where all the parameters can be easily validated and changed so that the subsequent build steps are using a correct set of parameter values?