The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Grant Hulbert
ServiceNow Employee
ServiceNow Employee

When you purchase ServiceNow’s Cloud Call Center combined with Amazon Connect, you receive a powerful, out-of-the-box solution that delivers ServiceNow workflows to your employees through a simple spoken telephone conversation. Cloud Call Center for ITSM makes it easy to deflect your most common IT helpdesk issues automatically, and that’s great for ITSM.

But what if you want to solve customer issues as well? Luckily, there’s a simple way to extend the solution that allows you to deflect calls from customers. In this article, we will teach you how to add a simple Customer Service Management (CSM) feature that identifies callers who are customers, rather than employees, and allows them to create a new CSM case verbally. You’ll also learn about Operation Handlers and Amazon Lex Bots.

Before we start, there are several prerequisites to adding a CSM feature to Cloud Call Center for ITSM:

  • Admin access to a ServiceNow instance (Professional and higher entitlements) running New York or Orlando
  • Admin access to Amazon Connect
  • com.sn_customerservice plugin installed on your ServiceNow instance
  • Installation of Amazon Connect integration with Cloud Call Center, available here.
  • Installation of Cloud Call Center for ITSM, available here.
  • Configuration of Amazon Connect (follow these excellent instructions to do so).

Now that your instance is working with the base Amazon Connect integration for ITSM, employees can start calling your helpdesk on the phone to work with ITSM employee workflows such as unlocking accounts, managing incidents, etc. Next, we’ll add some new code to handle a simple CSM Case-creation workflow.

Step 1: Determine who the caller is by looking up their phone number

How you determine the caller is one difference between ITSM and CSM. For ITSM, the caller can be found in the sys_user table, but CSM keeps this information in the customer_contact table. We’ll make a change to the base system’s lookup, so it searches customer_contact instead.

  1. On ServiceNow, navigate to Cloud Call Center – Core > Operation Handers
  2. Open interactionEvent
  3. Change line 17 to the following:
    1. userGr = new GlideRecord('customer_contact');
  4. Click [Update] to save your changes

Now, when callers dial in, ServiceNow will find their phone number in CSM’s customer_contact table.

Step 2: Create an Operation Handler that creates a Case record

Operation Handlers ‘listen’ for commands from Amazon Connect Lex Bots. We’ll create the ServiceNow side first. Then in the next step, we’ll move over to Amazon to create the Lex Bot. Our goal is to create a new case in sn_customerservice_case. Most of this code is borrowed from ITSM’s createIncident Operation Handler.

  1. Click [New] to create a new Operation Hander
  2. Name it “createCase” Note: this name must match the Amazon Lex Bot’s name perfectly, so make sure you type it exactly as shown here
  3. Replace the stub code with the following script
  4. (function(/*CTIOperationRequest*/ request, /*CTIOperationResponse*/ response, /*context*/ ctx) {
      var lang = request.getLanguage();
      try { 
        var interactionGr = request.getInteractionRecord();
        var short_description = request.getParameter('case_short_description');
    
        var gr = new GlideRecord('sn_customerservice_case');
        if(interactionGr) {
          gr.setValue("contact", interactionGr.opened_for.toString());
        }
        gr.setValue("contact_type", "phone");
        gr.setValue("short_description", short_description);
        gr.insert();
    
        var notes = gs.getMessageLang("Case {0} has been created.", lang, [gr.getValue("number")]);
    
        response.setStatusCode(200);
        response.setMessage(notes);
    
        if(interactionGr) {
          interactionGr.work_notes = notes;
          interactionGr.update();
          
          var grRelated = new GlideRecordSecure('interaction_related_record');
          grRelated.initialize();
          grRelated.document_id = gr.sys_id;
          grRelated.document_table = gr.getTableName();
          grRelated.interaction = interactionGr.sys_id;
          grRelated.insert();
        }
      } catch(e) {
        ctx.setError(e);
      }
    })(request, response, ctx); 
  5. Click [Submit] to save the new Operation Handler

Step 3: Create an Amazon Lex Bot that sends createCase command to ServiceNow

  1. Log in to your Amazon Console Lex home: https://console.aws.amazon.com/lex/home
  2. Open the Lex Bot that you created when you configured Cloud Call Center
  3. Create a new Intent, and name it “createCase,” just like the name of your ServiceNow Operation Handler. Again, it’s super-important to make sure these strings match
  4. Create a sample utterance: “create a case”
  5. Click the checkbox [x] Initialization and validation code hook
  6. Choose the same Lambda function that’s used by all the other intents. It will have a name like snABCDELambda
  7. Create a slot named case_short_description, with a prompt “Please describe your issue.” We’ll create a slot type in the next step
  8. In the Fulfillment section, select (•) AWS Lambda function, and choose the same Lambda function as before.

Next, we’ll build a slot that captures the caller’s response. Leave your Lex Bot screen open.

Step 4: create a slot type that elicits a verbal response from the caller

  1. Make sure you are on the same Lex Bot page you opened in step 3
  2. Create a new slot type, and name it “CaseDescription”
  3. Enter a list of example values that are typical for your cases. In this example, we used “Where is my order?”, “Track my order”, “What happened to my shipment?”, “I have a billing issue”, “What's the status of my order?”, “Track my shipment”, “My order didn't arrive”, and “Where's my stuff?
  4. Click [Add slot to intent]
  5. Find the slot type column in your Lex Bot (next to case_short_description) and select CaseDescription from the popup
  6. Click [Build], then click [Publish]

Here’s a screenshot showing the Lex Bot we just made:

 find_real_file.png

Here’s a screenshot showing the slot type we created for the Lex Bot prompt:

find_real_file.png

All done! Now, try it out!

  1. Enter your own phone number into a CSM Contact record (this makes it possible to look up the record when you call)
  2. Call the helpdesk phone number you selected when you created your Amazon Connect instance
  3. Say “create a case.
  4. When prompted to describe the issue, mention a problem like “Where’s my order?”
  5. Go back to ServiceNow and confirm that an interaction record and a related case were created, including a short description that matches what you said

Conclusion:

You have learned how to make a small addition to Cloud Call Center Operation Handlers to work with CSM, and how to write a simple Amazon Lex Bot that connects to that Operation Hander. Now your CSM customers can phone in to create new cases in Customer Service Management.

Authors:

Grant Hulbert, Director, Office of Innnovation
Zach Dubin, Thought Leadership Researcher & Writer

Comments
Des King
Tera Expert

Is there any easy way to pass the Amazon Connect Queue name to the interaction and/or the case record?

Version history
Last update:
‎05-29-2020 10:32 AM
Updated by: