---
sourceDocument: Zurich IT Operations Management
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/it-operations-management

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Create an action for an 'on Resource operation' policy

# Create an action for an 'on Resource operation' policy {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

The on Resource operation trigger fires during the Orchestration process when a user performs a Start, Stop, or Deprovision life cycle operation on a specific resource. A policy that is triggered by the on Resource operation trigger can override a user-requested attribute value, run a script, call a Cloud API, or perform an IP address management operation.{#create-action-on-resource-op__shortdesc-action-on-resource-op}

## Before you begin

* Role required: sn_cmp.cloud_governor or admin
* Optional: [Create one or more cloud
  policy groups](https://www.servicenow.com/docs/l_RHiFk3I07_hypiTFuZ1Q "A cloud policy group is a container for related policies. Consider grouping policies that are often used together or should be considered together. Grouping policies can help you to apply policies consistently across your organization.").
* [Configure a cloud policy rule](https://www.servicenow.com/docs/sM4bp4yg5~0i_K3~tql~EQ "A policy rule is a collection of conditions and actions. ​If all conditions evaluate to true, the policy engine performs the actions. If any condition evaluates to false, the policy engine does not perform the actions.") and associated conditions.
{#create-action-on-resource-op__ul-prereqs-for-policy-action}

## Procedure

1. In the Cloud Admin Portal, navigate to GovernPolicies.
2. Open a cloud policy and set the policy to the Draft state if needed.
3. Open the rule that should perform the action and then click New on the Policy Rule Actions related list.
4. On the popup, click Create for the type of action to perform, enter a unique and meaningful Action Name, and then fill in the form for the action.  
   {#create-action-on-resource-op__table_qhx_32h_sfb__entry__2}

   | Field | Description |
   |-|-|
   | Property | Specify the name of the property (attribute) on the user request form to override. |
   | Value | Enter a value that overrides the value in the Property field. You can override text values only. You can specify a static value, an expression, or both. The example action, named SetTheCostCenter, specifies the value Marketing for the CostCenter property.Figure 1. Configure a Property Override action Note: When both a policy rule and a form rule overwrite a value, the value in the form rule is used. Expressions can perform the following actions (see Using expressions in Cloud Provisioning and Governance for details): * 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}` {#create-action-on-resource-op__ul_r3r_knb_4z} |
   | Is Script Based | Select the check box to display the Script text box and then specify the script. You can use the following example script snippet to override a stack name. The `function( formData)` section of the script modifies the values for fields on the form. <kbd class="ph userinput">MyStack</kbd> is the stack name in this example. 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; }, |
   [Table 1. Settings for the 'Property Override' action]

   {#create-action-on-resource-op__table_qhx_32h_sfb} {#create-action-on-resource-op__table_nbq_j2h_sfb__entry__2}

   | Field | Description |
   |-|-|
   | Action Script Category | Select a category. |
   | Action Script Name | Specify a unique and meaningful name for the script. |
   | Action Script | Create the script in the text box. See Create a policy action script for details. |
   [Table 2. Settings for the 'Execute a Script' action]

   {#create-action-on-resource-op__table_nbq_j2h_sfb}

   If you select the Call Cloud API action type
   and save the record, the Policy Rule Action Attributes related list is populated with the
   attributes to pass to the provider. If you are integrating with Infoblox, you must configure
   the DNSSuffix field. When you create a host, for example, the value
   in the DNSSuffix field appears in Infoblox for the newly created
   virtual machine.
   {#create-action-on-resource-op__table_pmz_12p_sfb__entry__2}

   | Field | Description |
   |-|-|
   | Action Name | Enter a descriptive name for the action. In subsequent policy actions for the same policy, you can reference this name in a Value field. It refers to the JSON payload that is received from the cloud provider after an API call. For example, to reference an allocated IP address that was returned by the action that is named RefAction, you can use the following expression in the Value field of another policy action: `$(parameter.RefAction.Allocated_IP}`. |
   | Provider | Enter the cloud provider from the API library. |
   | Version | Enter the version from the API library. |
   | Interface | Select a CAPI interface. For Infoblox, select IPAM interface. |
   | Operation | Select a CAPI interface operation to perform. For Infoblox, select CreateHostRecord or DeleteHostRecord. |
   | Credentials | Enter the sys_ID of the necessary credentials. You can also use an expression like: $(ci.sn_cmp_infoblox_server[$(ci.sn_cmp_ip_pool[subnet=${parameter.formData.SubnetId}].provider_instance)].infoblox_server_credential) |
   | Endpoint URL | Enter the endpoint URL of the connector from the API library. For Infoblox, it is the IP address of the Infoblox server. |
   [Table 3. Settings for the 'Call Cloud API' action]

   {#create-action-on-resource-op__table_pmz_12p_sfb} {#create-action-on-resource-op__table_ncj_b2p_sfb__entry__2}

   | Field | Description |
   |-|-|
   | IPAM Method Name | Select the IPAM Method Name. For Infoblox, select one of the following options: * Release IP Address: Release an IP address from Infoblox when a machine is deprovisioned. * Register IP Address: Register a new virtual machine to Infoblox. This option is used by AWS and Azure clouds. * Reserve IP Address: Reserve a new IP address. This option is used by a vSphere cloud. {#create-action-on-resource-op__ul_xfv_kcd_4z} See [Register IP addresses for AWS and Azure virtual machines in Infoblox](https://www.servicenow.com/docs/3npgcshKJcLclYrML8zyAA "Create a policy to register IP addresses for AWS and Azure virtual machines in Infoblox, once these virtual machines are provisioned."), [Reserve IP addresses for VMware vSphere virtual machines in InfoBlox](https://www.servicenow.com/docs/ElNb~TSHFgXqmj6xPyxqEA "Create a policy to reserve IP addresses for VMware vSphere virtual machines in Infoblox, at the time of provisioning the virtual machines."), and [IPAM integration](https://www.servicenow.com/docs/qe6BgNicqUVsownrOmr1rA "Use an IP address management (IPAM) tool like Infoblox to manage cloud IP addresses, networks, and subnets within your cloud catalog offerings. However, it's important to note that this functionality is not supported with our template-based cloud catalogs."). |
   [Table 4. Settings for the 'IP Address Management' action]

   {#create-action-on-resource-op__table_ncj_b2p_sfb}

*[\>]: and then


