ServiceNow helps you build digital workflows on a single, unified platform. Kore.ai XO Platform’s ServiceNow Agent integration allows you to seamlessly hand off the virtual assistant conversations to your live agents on ServiceNow.
This post provides the configuration steps to enable the ServiceNow Agent integration in the Tokyo version. Use the configurations provided below as general guidelines, as there could be some differences based on the release and the specific version of the ServiceNow that you are using.
Overview
Kore.ai’s Virtual Assistant (VA) serves as the central point of interaction for the users. In addition to its regular capabilities, the VA acts as a proxy or intermediary between the users and the ServiceNow agents to hand over conversations seamlessly. The VA also allows you to integrate with the ServiceNow platform. The VA facilitates communication and interaction between the user and the ServiceNow agent using the chat module.
Configuration
Complete the following steps to configure the ServiceNow agent for Tokyo and lower versions:
- Step 1: Retrieve the ServiceNow Instance URL
- Step 2 : Create a New Queue
- Step 3: Enable the ServiceNow Agent
- Step 4 : Switch to UI16 Theme
- Step 5: Install required plugins
- Step 6: Create a user with agent_admin role
- Step 7: Create a group and add the user created to the group
- Step 8: Define the Host URL in the REST Message in ServiceNow
- Step 9: Define Outbound REST Message Requests in ServiceNow
- Step 10: Define Outbound REST Business Rules in ServiceNow
- Step 11: Testing Configuration
Step 1: Retrieve the ServiceNow Instance URL
- Log in to your ServiceNow account with admin user credentials. The ServiceNow account will have a unique URL for each developer instance in their Service Management or App Engine Studio, for example: https://devXXX67.service-now.com/.
- Copy the Instance ID from the URL and paste it into the Configurations tab of the ServiceNow Agent page. Refer to step 3.
Step 2: Create a New Queue
- Log in to your ServiceNow account.
- From the main menu on the left, search and select Queues under Connect > Support Administration and click on the New button.
- In the Queue dialog, enter the following queue details:
- Click the New button in the Chat Queue Entries section and assign the chat queue entry to a user as shown below:
- Click Submit to save the chat queue entry details.
- Click Submit again to save the queue details.
- Copy the ID from the Queue ID field.
Step 3: Enable the ServiceNow Agent
- Log in to the Kore.ai XO Platform: https://bots.kore.ai/botbuilder
- Select a Virtual Assistant for which you want to configure the ServiceNow agent.
- Navigate to Build > Integrations > Agent Transfer and click the ServiceNow button.
- On the Configurations tab, select your preferred authentication option (Basic vs. OAuth) and then provide the details as explained in the options below:
Option1: Basic Auth – Enter the ServiceNow Instance credentials
-
- Select the Connect Support (Supported for Tokyo and lower versions) option.
- Select the Basic Auth option for enabling ServiceNow Agent with the Basic Authentication.
- Instance URL: The company’s URL where the ServiceNow instance is hosted. For example, the instance URL is in this format: https://devXXX67.service-now.com/.
- User Name: The username of your ServiceNow account.
- Password: The password of your ServiceNow account.
- Queue ID: The unique queue identification number.
- Webhook URL: The web URL for custom application function callbacks.
Option 2: OAuth with Refresh Token – Follow the instructions in this ServiceNow Documentation to generate a refresh token.
- Select the Connect Support (Supported for Tokyo and lower versions) option.
- Select the OAuth with Refresh Token option for enabling ServiceNow Agent with the Refresh Token Authentication.
- Instance URL: The company’s URL where the ServiceNow instance is hosted. For example, the instance URL is in this format: https://devXXX67.service-now.com/.
- Client ID: The client ID of your ServiceNow application copied in Step 8.
- Client Secret: The client secret of your ServiceNow application copied in Step 8.
- Refresh Token: The unique refresh token that you generated in Step 8.
- Webhook URL: The web URL for custom application function callbacks.
-
- Click Authorize to authenticate and allow the XO platform to handover conversations to ServiceNow agent.
- If you want to make ServiceNow as the default agent, enable the Default Agent System for all bot channels option.
Note: This option is enabled only when you have multiple agents configured for your VA.
- You can customize the channel mapping by clicking the Configure link as shown below:
- Once you click Configure, you can map the channels for which you want to use ServiceNow agent to hand over the conversations.
For example, if you have configured a Genesys chat integration, Intercom and ServiceNow agents. You can make one of them as default and map channels to agent systems. In this case, the Web Client and WebHook are mapped to Genesys and Intercom. Slack is mapped to the default ServiceNow agent. To learn more about channel enablement, see Adding channels to your bot. - After mapping channels, click Done.
- Click Save to enable the ServiceNow agent.
- Publish the VA. For more information, see Publishing Bot.
Step 4: Switch to UI16 theme
- Log in to your ServiceNow account with admin user credentials. The ServiceNow account will have a unique URL for each developer instance in their Service Management or App Engine Studio, for example: https://devXXX67.service-now.com/.
- Select the All menu, search for the System Properties filter, and click New.
- Enter the glide.ui.polaris.on_off_user_pref_enabled property, select the type as true|false, and click Submit.
Note: This property provides an option for the user to toggle between “Next experience and UI16” and classic experience. - Click on the System Admin profile and select the Preferences menu.
- Turn on the Turn off Next experience toggle.
- The App Engine Studio view switches from Next Experience to UI 16 theme.
Step 5: Install the required plugins
- Log in to the ServiceNow Developer instance with Admin User Credentials.
- To create an application, search and select the System Definition under Plugins from the left menu.
- Search for the Consumer Service Portal plugin and install it.
- After the successful installation, a new Connect support menu item appears in the left navigation bar.
Step 6: Create a user with agent_admin role
- Log in to the ServiceNow instance with the admin user credentials.
- Navigate to User Administration > Users > New.
- Fill in the details to create a user and click Submit.
- Select the Roles tab and click the Edit button to navigate to the roles screen.
- Search for the agent_admin role and add it to the user.
- Click Save.
Step 7: Create a group and add the user created to the group
- Create a group if you don’t have a group or use an existing group in ServiceNow.
- Navigate to User Administration > Groups.
- Click New.
- To create a new group, fill in the appropriate details and click Submit.
- Edit the group created above. Scroll down to the Group Members tab and click Edit.
- Select the agent created in the previous step and add it to the current group.
- Click Save.
Step 8: Define the Host URL in the REST Message in ServiceNow
- Log in to your ServiceNow account. The ServiceNow account will have a unique URL for each developer instance in their Service Management or App Engine Studio, for example, https://devXXX67.service-now.com/ .
- Go to System Web Services > Outbound > REST Messages from the left menu.
- In the REST Messages page, click the New button to create a new REST Message.
- Copy the WebHook URL from Kore.ai’s virtual assistant configuration page and paste it into the Endpoint URL field.
- Click Save to save the new REST message.
Note: You can also see a list of all the REST Messages that have been configured.
Step 9: Define Outbound REST Message Requests in ServiceNow
- To define REST Outbound Message, navigate to System Web Services > Outbound > REST Messages in the left menu.
- Select the REST Messages for which you want to define the Outbound message from the list of REST Messages. For example, search and select the Platform – Agent Integrations message.
- In the REST Message form, you can enter the API details, such as the name, endpoint URL as Callback URL from the Configurations page, and HTTP method.
Note: This will be the endpoint through which ServiceNow will send Agent’s messages to the user. - To define the HTTP header, click the HTTP Request tab and select the Add New Row button.
- In the new row, add the HTTP Header as shown below:
- HTTP Header: Name: Content-Type, Value: application/json
- Method: Add the POST method and paste the Webhook URL that you copied from the Configurations tab in the Endpoint field.
- Once you have entered the required details, click the Update button to save the REST Message.
Step 10: Define Outbound REST Business Rules in ServiceNow
- To define an Outbound rule, search and select the Business Rules under System Definition from the left menu.
- Click the New button to configure the Business Rule.
- Enter the following business rule details:
- Name and select the live_message table from the Table drop-down.
- Select the Active and Advanced check boxes.
- Click the When to run tab, and select after from the When drop-down, and select the Insert checkbox.
- Add Filter conditions to execute this Business rule if created by is not a chatbot_interface.
- Click the Advanced tab, add the code below and click Submit:
var request;
request = new sn_ws.RESTMessageV2('Platform - Agent Integrations', 'Platform - Agent Integrations');
request.setRequestBody("{\"group\":\""+current.group+"\", \"formatted_message\":\""+GlideStringUtil.escapeForHomePage(current.formatted_message)+"\", \"sys_created_by\":\""+current.sys_created_by+"\",\"last_message\":\""+current.last_message+"\", \"sys_id\":\""+current.sys_id+"\"}");
request.setRequestHeader("Content-Type", "application/json");
var response = request.execute();Note: The code is optional. It is recommended to use the code when you face any issues during execution. This rule executes the API configured in REST Message.
Step 11: Testing Configuration
This section helps you verify how the conversations from the Kore.ai XO Platform are handed over to the ServiceNow agent after enabling it.
To verify the data exchange between Kore.ai’s VA and ServiceNow agent, follow these steps:
-
- Open a virtual assistant for which you have enabled the ServiceNow agent.
- Create a new Agent Transfer Node task. For example, create a Platform Agenttask with the UserAgent node and configure it to use the ServiceNow agent. For more information, see Agent Transfer Node.
- Click the Talk to Bot icon to launch the VA and enter Help.
- Log in to the ServiceNow Instance, select the Impersonate User from the Profile option as shown:
- Enter the Username that you created. For example, select the Abel Tuter username.
- Select All and navigate to Workspace Experience>Workspaces>Agent Workspace Home.
- In the Agent Workspace page, select Inbox and set the Status to Available.
- When a user initiates the chat from the VA, it transfers the conversation to the ServiceNow agent and sends a message to the user.
- Agent receives a notification about this on ServiceNow.
- Now, the connection between the ServiceNow agent and the user has been established, and the conversation continues.
Enable Attachment Sharing with Live Agents
Follow these steps:
- Log in to your ServiceNow account with admin user credentials.
- Go to System Properties > sys_cs_provider_application.list > Configure > Form Layout.
- In the Trusted Media Domains field, enter the domain you want to send and receive the attachments.