Creating a business rule in ServiceNow for creating information events for trouble tickets

After configuring Proactive Service Resolution for ServiceNow Telecommunications and Media Assurance Workflows, 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 trouble ticket every time a ticket 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 API access key and the tenant ID for your BMC Helix tenant. 
    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 ticket 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: 

      (function executeRule(current, previous /*null when async*/ ) {
      
          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=true'
          );
          request.setHttpMethod('POST');
      
          var tenantId = '<tenant_ID>';
          var accessKey = '<access_key>;
      
          request.setBasicAuth(tenantId, apiKey);
          request.setRequestHeader('Accept', '*/*');
          request.setRequestHeader('Content-Type', 'application/json');
      
                    var body = {};
                    body.ticket_id = id;
                    body.display_id = current.getValue('number');               
                    body.label = label;                              
      
      
          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=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 for your BMC Helix tenant.
  6. Save changes to the business rule. 

Based on the business rule, every time a trouble ticket is created, updated, or deleted in ServiceNow Telecommunications and Media Assurance Workflows, 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 trouble tickets. For more information, see Viewing automation policy runs history

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

Comments