Creating a business rule in ServiceNow for creating information events for incidents

Important

Proactive Service Resolution for ServiceNow incident management is deprecated. For more information about the impact and recommendations, see Deprecated and discontinued features

After configuring Proactive Service Resolution for ServiceNow Incident Management, you must create a business rule to be able to create information events in BMC Helix Operations Management. The information events include information about the incident every time an incident is created or updated. 

For more information about business rules, see the ServiceNow documentation. 


Before you begin

You must obtain the API access key and tenant ID for your BMC Helix tenant before creating a business rule. 

  1. Log on to BMC Helix Portal and navigate to User Access > Access keys.
  2. If a key is not created for BMC Helix Intelligent Automation, click Add key and enter the key name.
  3. Select the key type as Access and click Confirm.
  4. Click Copy all key details and paste the content in a notepad. 
    You get the key details and the tenant ID for your BMC Helix tenant. 

    Sample key details
    key details:AU7RRPF1*****************I09TR3::urdx0zOVd7iqiQAhy4DyLryZt92o1i3iGU25fImmAeVS9YwZyA,tenant id: 10****5936


    For more information, see the To create an access key for user access section in Setting up access keys for programmatic access Open link .

  5. If using an on-premises deployment of ServiceNow, ensure that the ServiceNow connector is configured and running by using the remote plugin in BMC Helix Intelligent Automation. 



To create a business rule in ServiceNow

  1. Log on to your ServiceNow application and navigate to All > System Definition > Business Rules.
  2. Click New.
  3. Enter a name for the rule. 
  4. Select the table depending on the type of incident that you want to create.
    For a case, select Case. For an incident, select Incident.
  5. Click Advanced and select the following options: 
    1. In the When to run tab, select after to run this rule after any of the selected actions take place.
    2. From the list of actions, select Insert, Update, and Delete.
    3. In the Advanced tab, copy and paste the following script.
      When you copy the key details from BMC Helix Portal, you get the key details and the tenant ID. Copy the entire key details string to use as the access key in the following script: 

      (function executeRule(current, previous /*null when async*/ ) {
      
          //gs.info("Webhook body: " + JSON.stringify(current));
          var id = current.getValue('sys_id');
          var label = current.sys_meta.label;
      
          var request = new sn_ws.RESTMessageV2();
          request.setEndpoint(
              'https://portal-helix.com/intelligent-automation/restplugin/api/v1/tmf/callback?snow_nontmf=true'
          );
          request.setHttpMethod('POST');
      
      
          var tenantId = '<tenant_ID>';
          var accessKey = '<access_key>';
      
          request.setBasicAuth(tenantId, accessKey);
          request.setRequestHeader('Accept', '*/*');
          request.setRequestHeader('Content-Type', 'application/json');
      
       
          var body = {};
          body.ticket_id = id;
          body.display_id = current.getValue('number');
          body.caller_id = current.getValue('caller_id');
          body.priority = current.getValue('priority');
          body.company = current.getValue('company');
          body.description = current.getValue('description');
          body.correlation_id = body.short_description.substr(50);
          body.status = current.getValue('state');
          body.cmdb_ci = current.getValue('cmdb_ci');
          body.assigned_to = current.getValue('assigned_to');
          body.short_description = current.getValue('short_description');
      
          request.setRequestBody(JSON.stringify(body));
      
          var response = request.execute();
      
      })(current, previous);
    4. In the script, make the following changes: 
      1. For the request.setEndpoint parameter, specify the REST API URL where your BMC Helix Intelligent Automation is available. 

        Note

        If using an on-premises version of ServiceNow, set the request.setEndpoint to http://hostname:port/intelligent-automation/remote-restplugin/api/v1/tmf/callback?snow_nontmf=true, where the hostname is the host where the ServiceNow connector (remote plugin) is running, and the port is the value specified for the config.port parameter in the plugin.properties file. 

      2. For the tenantId parameter, specify the BMC Helix tenant ID. 

      3. For the accessKey parameter, specify the access key (combination of access key and secret key) for your BMC Helix tenant.
        For example, AU7RRPF1*****************I09TR3::urdx0zOVd7iqiQAhy4DyLryZt92o1i3iGU25fImmAeVS9YwZyA.
  6. Save changes to the business rule. 

Based on the business rule, every time an incident is created, updated, or deleted in ServiceNow Incident Management, an information event with the appropriate details is created in BMC Helix Operations Management.  


Where to go from here

After successfully configuring ServiceNow, you can directly view the status of the automation policies run by BMC Helix Intelligent Automation for creating incidents. For more information, see Viewing automation policy runs history

Was this page helpful? Yes No Submitting... Thank you

Comments