ersureshbe
Giga Sage
Giga Sage

Hi There,

 

A prevalent use case exists across various businesses, wherein each organization possesses distinct bot functionalities. ServiceNow offers a pre-built and reliable virtual agent along with bot capabilities. Some business teams prefer to utilize the ServiceNow virtual agent solution as their primary tool while simultaneously maintaining a legacy bot for specific business reasons, such as dependencies or existing legacy bot licenses that need to be utilized until their end of life.

 

The ServiceNow Virtual Agent Bot and the Legacy Bot operate independently, yet ServiceNow possesses robust capabilities to integrate with legacy bot systems. This integration facilitates the management of bot hierarchies and enhances chat functionalities effectively.

 

This article outlines a step-by-step approach to integrating the ServiceNow Virtual Agent Bot with the Legacy Bot. The process is categorized into four stages to achieve the desired outcome:

 

1. Installation
2. Configuration
3. Implementation
4. Testing

 

1. Installation:
Two plugins are necessary and should be regarded as prerequisites.
a. Virtual Agent
b. Virtual Agent API
Please ensure that both of these plugins are installed in your ServiceNow environment.

 

2. Configuration:
After installing the 2 plugins, please concentrate on the subsequent configuration within the ServiceNow environment.
a. Navigate to sys_properties_list.do and ensure that va.bot.to.bot.logging_enabled is set to true.
b. Access sys_cs_channel_list.do, select the Name field, and verify that the Bot to Bot Synchronous option is set to True.
c. Go to System Web Services, then Scripted Web Services, followed by Scripted REST APIs, and locate VA Bot Integration. Confirm that the BOT Integration Requires Authentication setting is true.

 

3. Implementation:
a. Please provide the endpoint to the legacy Bot team. For reference, the link for endpoint consumption is as follows:
https://instance-name.service-now.com/api/sn_va_as_service/bot/integration
b. Establish the Service Account with the virtual_agent_admin role assigned.
c. Distribute the payloads for initiating a conversation, accessing a topic, switching topics, and concluding a conversation, among others.

 

action: Start_Conversation, End_Coversation | text : hi, bye, topics | UserID : guest, account holders

 

Request Payload
{
"requestId": "12076-3caf-4139",
"action": "START_CONVERSATION",
"enterpriseId": "ServiceNow",
"nowBotId": "null",
"nowSessionId": "null",
"clientVariables": "",
"message": {
"text": "",
"typed" : true,
"clientMessageId": "xxxx-xxxx49",
"attachment": null
},
"timestamp": "1633343833",
"botToBot": "true",
"silentMessage": "null",
"intent": "null",
"contextVariables": "",
"userId": "suresh.loganathan",
"emailId": "ersureshbe@gmail.com"
}

Key Points & Fields -> action: SWITCH | topic: name | text : hi, bye

{
"requestId": "12Q76-3caf-4139",
"clientSessionId" : "sessionId",
"action": "SWITCH",
"topic": {
"id" : "",
"name" : "Business Support Hours"
},
"message" :{
"attachment" : {
"url" : ""
},
"text" : "",
"typed" : "true"
},
"contextVariables" : {
},
"userId": "suresh.loganathan",
"emailId": "ersureshbe@gmail.com"
}

 

4. Testing:
a. Utilize the REST API Explorer to choose the appropriate namespace, API Name, and Operation.

ersureshbe_0-1730239541043.png

b. Following the implementation, conduct an End-to-End test from the legacy Bot to the ServiceNow Virtual Agent Bot.

 

Hope you like it. If any questions or remarks, let me know!

If this helped you in any way, I would appreciate it if you hit bookmark or mark it as helpful.

 

Regards,
Suresh.

Comments
SushmaGM
Tera Explorer

Hi Suresh,

Great article!!!!!

I have a doubt here , the request payload mentioned above will be triggered from Legacy Bot and to accept this payload as request, where do we have to mention this in servicenow so taht it understands the request.

Need your suggection here.

 

Thanks,

Sush

Version history
Last update:
‎10-29-2024 03:16 PM
Updated by:
Contributors