Create a Variable to Measure Service Quality

A variable is a temporary data item that is assigned a default value at the start of rules processing. You can define rule actions that update the variable during rules processing, and you can also define conditions based on the value of the variable.

A common example of a variable is a score that you set and modify according to the conditions you define. Then you can assign different actions based on the variable value.

In this example, let’s assume that you want to be sure your management team is aware of high-priority service issues.

  • Your organization expects your agents to communicate positively with all customers.
  • Because the XYZ Corporation constitutes a significant part of your business, you want to be sure that contacts from that company are satisfied with the service they receive from your organization.
  • You want to be especially sure that managers from the XYZ Corporation are happy with your service.
Note: A custom field can also accomplish the same function as a variable. The difference is that the value of the custom field is stored in the database at the end of rules processing. If its value changed during rules processing as a result of actions applied to it, that value remains and is what the custom field contains the next time the object is processed by the rules engine. In contrast, the value of a variable is not stored in the database, so its value is always 0 when rules processing begins the next time.
  1. Create a variable called service_quality.
  2. Create rules that set the value of the variable.
    Because you want the variable to change based on different conditions, you will need multiple rules to accomplish this. Rather than adding these rules to a state, create a function that scores the incident. Then you can call the function from multiple states instead of having to add the set of rules to each state from which you want to run them.
    1. Create a function called Service Quality Scoring.
    2. Create rules within the Service Quality Scoring function that assign the appropriate weighting to the various factors you want to track. You might choose to create a set of incident rules similar to these to identify service issues:
      • If the staff member’s SmartSense rating is Somewhat Angry, Angry, or Very Angry, then increment the value of service_quality by +6.
        This figure shows the variable service_quality incremented by +6.
      • If the staff member’s SmartSense rating is Neutral, then increment the value by +1.
      • If the organization is the XYZ Corporation, then increment the value by +2.
      • If the customer SmartSense is Somewhat Angry, Angry, or Very Angry, then increment the value by +6.
      • If the contact type is Manager or Vice-President, then increment the value by +2.
  3. Create rules that specify the actions for different values of the variable.
    You might decide that high values of the service_quality variable warrant attention from a customer support supervisor or manager. Your rules might look like these two figures:
    • If service_quality is greater than 5 and less than or equal to 7, then email the incident information to the customer support supervisor at your organization.
      This figure shows the If, Then setting described in the surrounding text.
    • If service_quality is greater than 7, then email the incident information to the manager of customer support.
      This figure shows the If, Then setting described in the surrounding text.

Results:

Using these rules, you can see that:
  • No email is triggered if a manager (+2) at XYZ (+2) is happy or neutral (no change because rule conditions are not met), and if the agent SmartSense rating is neutral (+1). In this situation, the value is 5 (2+2+1).
  • Any time a staff member’s SmartSense rating registers anywhere in the angry range, the customer support supervisor is notified, because the value is at least 6.
  • An angry customer will trigger a notification to the supervisor, because the value is also 6.
  • An unhappy (+6) manager (+2) from XYZ (+2) results in a service_quality value of at least 10, and possibly more, depending on the agent’s SmartSense rating. This situation triggers an email to the manager of your customer support department.
Note: Whenever the rules engine begins processing a new or updated incident, the value of the service_quality variable is initialized to 0 again.