Creating project template properties

Properties can be used to manage variables passed into commands, agent filters, and custom stamping algorithm templates.

Properties use the syntax ${property:[property_name]} to pass property values. You can nest properties to create more specific output. Create a nested property by combining multiple properties. For example, if you want to pass the project name using properties: project_name=project_1.0.0_appA and the version number is passed in the $version property. If the nested property is defined as follows:
${p:project_${p:version\}_name}
and the value for the version property is 1.0.0, the property first resolves to
${p:project_1.0.0_name}
which resolves to the value: project_1.0.0_appA. There is no limitation on the number of nested properties. Wildcards are not supported. A "\" is required before closing each nested property.

From the Properties window, you can edit defined properties using the edit icon ( edit icon) and move their position using the drag and drop icon (drag and drop icon).

  1. From the IBM® UrbanCode™ Build dashboard, click Templates, then click a project template.
  2. Click the Properties tab.
  3. Click Create Property.
  4. In the Create New Property window, type a name for the property in the Name field.
    The property can be referenced by using the property syntax: ${p:property_name}.
  5. Select a display type from the Display Type list.
    The display type determines how the property is presented to users in the user interface. Based on the type you select and the Values field value selected, additional configuration fields are displayed. For most types, the Default Value field is displayed where you can specify a default value.
    Select one of the following types:
    • Agent Pool provides a list of agent pools. If selected, the Agent Pool field is displayed, where you can specify a default agent pool.
    • Checkbox provides a check box. If the box is checked, the value is true; otherwise, the value is false.
    • Integration Plug-in provides a list of integration plug-ins. Select the type of plug-in from the Plug-in type field.
    • Multi-select provides a list of values from which users can select multiple values.
    • Select provides a list of values from which users can select a single value.
    • Text provides a text-input field.
    • Text (secure) provides a text-input field in which user input is replaced by generic symbols.
    • Text Area provides a text-input field in which users can enter a large amount of text.
  6. Specify the rules for the selected display type in the Value field.
    Depending on the selected display type, some value-related fields might not be displayed.
    • If you want to specify the property rules now during design time, click Defined and configure the following fields.
      • If you want users to specify a value for the property, click Value Required.
      • Enter all possible values for this property in the Allowed Values text area. Put each value on a separate line.
      • Optionally, enter a default value for the property in the Default Value field.
    • If you want the property values to be generated by a preprocessing script, click Scripted and configure the following fields.
      • If you want users to specify a value for the property, click Value Required.
      • Enter a BeanShell script that generates property values in the Allowed Values Script text area. The script is passed the following implicit variables: project, workflow, buildLife. Put each value on a separate line. The script should return:
        • String value for text, text area, text (secure), and select types.
        • Boolean for the check box type.
        • String array or collection for the multi-select type.
        • The agent pool name for the agent pools type.
        • Null if the field is hidden for all property types.
      • Optionally, enter a BeanShell script that generates a default value in the Default Value Script text area.
    • If you want the property values to be generated by a job step, click Job Execution and configure the following fields.
      • If you want users to specify a value for the property, click Value Required.
      • Select an agent pool to run the job from the Agent Pool list.
      • Select the job that sets the property value from the Job list.
  7. Complete the configuration fields based on the type selected.
  8. Click Save.