-
Bug
-
Resolution: Fixed
-
Trivial
-
2.303.1
-
-
2.311
For a job with a text parameter defined, if the job is triggered through the API endpoint buildWithParameters and the text parameter isn't defined, then the parameter value becomes the wrong type and is visualized incorrectly in build parameter view. Even worse, if the rebuild plugin is used, then the input form for the parameter will be a one-line input box and not a text area, which causes new lines to be stripped.
Job config:
Build parameters view:
Rebuild view:
So what goes wrong; when buildWithParameters is called, it goes through parameter definitions and offer them to contribute parameters. For text parameters (TextParameterDefinition), it eventually ends up in
ParameterDefinition#getDefaultParameterValue() when no value is supplied for the parameter. It then relies on the implementation in StringParameterDefinition()#getDefaultParameterValue(). Unfortunately that implementation returns StringParameterValue class instances and not instances of type TextParameterValue. This is then incorrectly used to visualize the parameter value.
- links to