Description
Parameters have default values. This article discusses how to change the parameter’s default value when based on a previous entry or some other circumstance.
Solution 1: Use modifyFormalParameter
- Initially, set the default to the actual numeric value, like 123.
- Add a step to the procedure that calls the “modifyFormalParameter” API with the “defaultValue” optional parameter.
- Set the default value to the value that is used in this job, so if user A sets it to 124, that becomes the new default for user B.
Solution 2: Use a dynamic Custom Parameter List with a property sheet
First create a property sheet, for example NewGen_CSM_Options
- Create a nested property called ‘optionCount’.
- The value equals the number of options in the dynamic list (example: 6).
- Create a nested property sheet for each option in the list, using
'option#'
nomenclature (example: option1).- Create a nested property called text within each
option
[#] sheet; the value equals the text that appears in the list. - Create a nested property called value within each
option
[#] sheet; the value equals the value that will be passed to CloudBees CD (CloudBees Flow) when the option is selected.
- Create a nested property called text within each
Add the menu as a parameter:
- Choose Type: Dropdown menu.
- Select load options from the list.
Example propertysheet reference:$
[/projects/.ARCHIVES/NewGen_CSM_Options]
Changing the value in the property sheet will now result in the changed value appearing in the dynamic Custom Parameter List.
0 Comments