This article will walk you through how to use the Rules Engine to extract the count of new cases every week from an object in Salesforce (in this case, we will use the Zendesk Custom Object) which can be seen as a line on the engagement graph.

Create Rule

Prior to setting up the new rule, you will need to add a new measure for the rule to push the data into. To learn more about adding new measures, click here.

  1. Navigate to Administration > Rules Engine.
  1. Click + RULE at the top right.
  1. Select Custom as the Rule Type.
  2. Enter a name for the rule.
  3. Provide a description for the rule in the Description box.
  4. Click NEXT. The Setup Rule appears.
  1. In the Show section, add Account:: ID, and the Zendesk Ticket ID. Update the aggregation type of the Zendesk Ticket ID to COUNT by clicking on the drop down arrow.
  2. In the Filters section, add Zendesk Ticket: Created Date.
  3. Select Apply to Gainsight customers only check box.
  4. (optional) In Advanced Logic, you can change the logic within Filters.
  5. Click Next to continue. The Setup Action screen appears.
  1. Click + ACTION.
  2. Select Load to Usage as the Action Type.
  3. In the Field Mappings section, map Account ID to Account (String) and Zendesk Ticket Count of Id Number to the new usage measure you created for this purpose. In this example, we are mapping to New_Cases.
  4. Click + FIELD MAPPING to choose additional mappings within Gainsight. In this example we have added the following:
  • Date - To drive what date to look at when the rule runs
  • Usage Data Aggregation Level Name (STRING) - To determine at what level this rule will aggregate data
  1. Click Save to continue. The Schedule screen appears.
  1. Select how often the rule must run. We recommend running this rule on a Weekly basis every Sunday.
  2. Select a Start Date.
  3. (optional) Select an End Date.
  4. Select a Preferred Start Time. Ensure you don't schedule anything from or to the same object at the same time because this will cause the rules to fail.
  5. Click Start to confirm the schedule.

Note: If the count of new Zendesk cases is zero, no record is added. Since this causes breakage in the trend line on the Engagement graph, the following additional rule can be added.

Rule to Populate Zeros

  1. Create a new rule to populate zeros.
  1. After entering information in the required fields, click NEXT. The Setup Rule screen appears.
  1. In the Show section, include Customer Info: Account.
  1. Click + ACTION.
  2. Action Type: Load to Usage
  3. Field Mappings: Map Customer Info Account to Account (String).
  4. Click + Add Field Mapping to choose additional mappings within Gainsight. In this example we have added the following:
    • Date - To drive what date to look at when the rule runs
    • New_Cases - set to 0
  5. Click Save to continue. The Schedule screen appears.

We will set the schedule the same as we did for the previous rule. Click Start to save.

This article walked you through how to use the rules engine to sync customers from Salesforce to Gainsight. To learn more about how to use the rules engine click here.