Policy Action form fields for trigger: on Blueprint provision

These fields appear when you create a policy action for a policy that is triggered on Blueprint provision.

Field Description
Action type Select an action type:
  • Property override: override a value that the user inputs on the catalog item form.
  • Execute a script: run a script on the instance.
  • Abort process: stop running the process on the selected item, such as the blueprint or stack.
Order of execution

Enter a number that tells the system which action to evaluate first in relation to others. The action with the lowest number runs first.

Is Script Based

[Property override action type]

Select to display the Script field.
Property Name

[Property override action type]

Enter the field on the form to override with another value. The field is derived from the blueprint form configuration. It gives the user values to select, such as the stack name.

[Property override action type]

Enter a value that overrides the value in the Property name field. You can use a static value, an expression, or both. Expressions can do the following:
  • Set form data values using definition expressions. For example: ${parameter.formData.CatalogAttributeType}
  • Assign user data values using definition expressions. For example: ${parameter.userData.userId}

    For example, the following value can set the stack name to Stack_Bob.Smith@company.com: Stack_${parameter.userData.userId}

  • Set stack or table values using runtime expressions.

    For example: $(ci.sn_cmp _ip_pool[subnet=${parameter.formData.Subnet Id}]) takes the subnet from the IP Pools table.

  • Associate a random number with a field using static expressions. Use: ${randomNumber}
Action script category

[Execute a script action type]

Select an action attribute category.
Action script name

[Execute a script action type]

Select a policy rule action script.

[Execute a script action type]

Review the script. To modify it, navigate to Cloud Management > Governance > Policy Script Category, and then click the script that belongs to the category. See Create a policy script for an explanation of the fields you need for cloud policy scripts.

[Abort process action type]

Enter a message that appears when the process aborts.
The following is an example of a script snippet you can use to override a stack name:
customScript : function( formData){
               // Manipulation of form parameter is only supported here. Change in any other attributes
               // will be ignored
               // data available for manipulation are
               // Form Data - Ex. StackName can be accessed through formData.StackName
               // formData.StackName = "MyStack";
               // User Data  - Ex. User Id can be accessed through this.parameters.userData
               // if(this.parameter.userData.userId == 'servicenowuserId')
                  formData.StackName = "MyStack";
                  return formData;

The function( formData) section of the script allows you to modify the values for fields on the form. In this case, the name MyStack will be used for the stack name.