Combine QnABot on AWS with ServiceNow
Do your workers look ahead to hours on the phone to open an IT ticket? Do they look ahead to an agent to triage a difficulty, which generally solely requires restarting the pc? Offering wonderful IT help is essential for any group, however legacy techniques have relied closely on human brokers being obtainable to consumption stories and triage points. Conversational AI (or chatbots) may help triage a few of these frequent IT issues and create a ticket for the duties when human help is required. Chatbots rapidly resolve frequent enterprise points, enhance worker experiences, and liberate brokers’ time to deal with extra advanced issues.
QnABot on AWS is an open supply answer constructed utilizing AWS native providers like Amazon Lex, Amazon OpenSearch Service, AWS Lambda, Amazon Transcribe, and Amazon Polly. QnABot model 5.4+ can also be enhanced with generative AI capabilities.
In accordance with Gartner Magic Quadrant 2023, ServiceNow is among the main IT Service Administration (ITSM) suppliers available on the market. ServiceNow’s Incident Administration makes use of workflows to determine, observe, and resolve excessive‑impression IT service incidents.
On this publish, we show how you can combine the QnABot on AWS chatbot answer with ServiceNow. With this integration, customers can chat with QnABot to triage their IT service points and open an incident ticket in ServiceNow in actual time by offering particulars to QnABot.
Watch the next video to see how customers can ask inquiries to an IT service desk chatbot and get solutions. For many ceaselessly requested questions, chatbot solutions may help resolve the problem. When a person determines that the solutions supplied aren’t helpful, they’ll request the creation of a ticket in ServiceNow.
Resolution overview
QnABot on AWS is a multi-channel, multi-language chatbot that responds to your buyer’s questions, solutions, and suggestions. QnABot on AWS is a whole answer and could be deployed as a part of your IT Service Desk ticketing workflow. Its distributed structure permits for integrations with different techniques like ServiceNow. Should you want to construct your individual chatbot utilizing Amazon Lex or add solely Amazon Lex as a part of your software, discuss with Integrate ServiceNow with Amazon Lex chatbot for ticket processing.
The next diagram illustrates the answer structure.
The workflow contains the next steps:
- A QnABot administrator can configure the questions utilizing the Content material Designer UI delivered by Amazon API Gateway and Amazon Simple Storage Service (Amazon S3).
- The Content material Designer Lambda perform saves the enter in OpenSearch Service in a query’s financial institution index.
- When QnABot customers ask questions prompting ServiceNow integration, Amazon Lex fetches the questions and requests the person to supply an outline of the problem. When the outline is supplied, it invokes a Lambda perform.
- The Lambda perform fetches secrets and techniques from AWS Secrets Manager, the place surroundings variables are saved, and makes an HTTP name to create a ticket in ServiceNow. The ticket quantity is then returned to the person.
When constructing a diagnostic workflow, you could require inputs to completely different questions earlier than you’ll be able to create a ticket in ServiceNow. You should use response bots and the doc chaining capabilities of QnABot to attain this functionality.
Response bots are bots created to elicit a response from customers and retailer them as a part of session variables or as a part of slot values. You should use built-in response bots or create a customized response bot. Response chatbot names should begin with the letters “QNA.”
This answer offers a set of built-in response bots. Check with Configuring the chatbot to ask the questions and use response bots for implementation particulars.
You should use doc chaining to elicit the response and invoke Lambda capabilities. The chaining rule is a JavaScript programming expression used to check the worth of the session attribute set to elicit a response and both route to a different bot or invoke Lambda capabilities. You’ll be able to determine the subsequent query within the doc by figuring out the query ID (QID) specified within the Doc Chaining:Chaining Rule area as ‘QID::‘ adopted by the QID worth of the doc. For instance, a rule that evaluates to “QID::Admin001” will chain to merchandise Admin.001.
When utilizing a chaining rule for Lambda, the perform identify should begin with the letters “QNA,” and is specified within the Doc Chaining:Chaining Rule area as ‘Lambda::FunctionNameorARN’. All chaining guidelines have to be enclosed in a single quote.
Deploy the QnABot answer
Full the next steps to deploy the answer:
- Select Launch Resolution on the QnABot implementation guide to deploy the most recent QnABot template through AWS CloudFormation.
- Present a reputation for the bot.
- Present an e mail the place you’ll obtain an e mail to reset your password.
- Make it possible for EnableCognitoLogin is ready to true.
- For all different parameters, settle for the defaults (see the implementation guide for parameter definitions), and launch the QnABot stack.
This publish makes use of a static webpage hosted on Amazon CloudFront, and the QnABot chatbot is embedded within the web page utilizing the Amazon Lex web UI sample plugin. We additionally present directions for testing this answer utilizing the QnABot consumer web page.
Create a ServiceNow account
This part walks by way of the steps to create a ServiceNow account and ServiceNow developer occasion:
- First, sign up for a ServiceNow account.
- Go to your e mail and make sure this e mail tackle on your ServiceNow ID.
- As a part of the verification, you’ll shall be requested to supply the six-digit verification code despatched to your e mail.
- You’ll be able to skip the web page that asks you to arrange two-factor authentication. You’re redirected to the touchdown web page with the ServiceNow Developer program.
- Within the Getting Began steps, select Sure, I want a developer oriented IDE.
- Select Begin Constructing to arrange an occasion.
When the construct is full, which can take couple of seconds to minutes, you may be supplied with the occasion URL, person identify, and password particulars. Save this info to make use of in later steps.
- Log in to the positioning utilizing the next URL (present your occasion):
https://devXXXXXX.service-now.com/now/nav/ui/basic/params/goal/change_request_list.do
.
Be sure you keep logged in to the ServiceNow developer occasion all through the method.
If logged out, use your e mail and password to log again in and get up the occasion and stop hibernation.
- Select All within the navigation bar, then select Incidents.
- Choose All to take away the entire filters.
All incidents shall be proven on this web page.
Create customers in ServiceNow and an Amazon Cognito pool
You’ll be able to create an incident utilizing the userid of the chatbot person. For that, we have to affirm that the userId of the chatbot person exists in ServiceNow. First, we create the ServiceNow person, then we create a person with the identical ID in an Amazon Cognito person pool. Amazon Cognito is an AWS service to authenticate purchasers and supply non permanent AWS credentials.
- Create a ServiceNow user. Be sure you embody a primary identify, final identify, and e mail.
Be aware down the person ID of the newly created person. You’ll need this when creating an Amazon Cognito person in a person pool.
- On the Amazon Cognito console, select Person swimming pools within the navigation pane.
If in case you have deployed the Amazon Lex net UI plugin, you will notice two person pool names; when you didn’t, you’ll see just one person pool identify.
- Choose the person pool that has your QnABot identify and create a new user. Use the identical userId as that of the ServiceNow person.
- In case you are utilizing the Amazon Lex net UI, create a person within the applicable Amazon Cognito person pool by following the previous steps.
Be aware that the userId you created shall be used for the QnABot consumer and Amazon Lex Internet UI consumer.
Create a Lambda perform for invoking ServiceNow
On this step, you create a Lambda perform that invokes the ServiceNow API to create a ticket.
- On the Lambda console, select Capabilities within the navigation pane.
- Select Create perform.
- Choose Writer from scratch.
- For Perform identify, enter a reputation, corresponding to
qna-ChatBotLambda
. (Do not forget that QnABot requires the prefixqna-
within the identify.) - For Runtime, select Node.js 18.x.
This Lambda perform creates new function. If you wish to use an present function, you’ll be able to change the default AWS Identity and Access Management (IAM) execution function by choosing Use present function.
- Select Create perform.
- After you create the perform, use the inline editor to edit the code for index.js.
- Proper-click on
index.js
and rename it toindex.mjs
. - Enter the next code, which is pattern code for the perform that you simply’re utilizing because the compute layer for our logic:
This perform makes use of the ServiceNow Incident API. For extra info, discuss with Create an incident.
- Select Deploy to deploy this code to the $LATEST model of the Lambda perform.
- On the Configuration tab, within the Atmosphere variables part, add the next:
-
- Add
SERVICENOW_HOST
with the worthdevXXXXXX.service-now.com
. - Add
SERVICENOW_USERNAME
with the worthadmin
.
- Add
-
- Copy the Lambda perform ARN. You’ll need it at later stage.
The following step is to retailer your ServiceNow person identify and password in Secrets and techniques Supervisor.
- On the Secrets and techniques Supervisor console, create a brand new secret.
- Choose Different sort of secret.
- Add your key-value pairs as proven and select Subsequent.
- For Secret identify, enter a descriptive identify (for this publish, servicenow/password). Should you select a unique identify, replace the worth of const
secret_name
within the Lambda perform code. - Select Subsequent.
- Depart Configure rotation on default and select Subsequent.
- Evaluate the key info and select Retailer.
- Copy the ARN of the newly created secret.
Now let’s give Lambda permissions to Secrets and techniques Supervisor.
- On the Lambda perform web page, go to the Configurations tab and navigate to the Permissions part.
- Select the execution function identify to open the IAM web page for the function.
- Within the following inline coverage, present the ARN of the key you created earlier:
Configure QnABot configurations
On this part, we first create some information questions utilizing the Questions characteristic of QnABot. We then create a response bot that elicits a response from a person once they ask for assist. This bot makes use of doc chaining to name one other bot, and triggers Lambda to create a ServiceNow ticket.
For extra details about utilizing QnABot with generative AI, discuss with Deploy generative AI self-service question answering using the QnABot on AWS solution powered by Amazon Lex with Amazon Kendra, and Amazon Bedrock.
Create information query 1
Create a information query for putting in software program:
- On the AWS CloudFormation console, navigate to the QnABot stack.
- On the Outputs tab, and open the hyperlink for
ContentDesignerURL
. - Log in to the QnABot Content material Designer utilizing admin credentials.
- Select Add so as to add a brand new query.
- Choose qna.
- For Merchandise ID, enter software program.001.
- Beneath Questions/Utterances, enter the next:
- Beneath Reply, enter the next reply:
- Develop the Superior part and enter the identical textual content in Markdown Reply.
- Depart the remaining as default, and select Create to avoid wasting the query.
Create information query 2
Now you create the second information query.
- Select Add so as to add a brand new query.
- Choose qna.
- For Merchandise ID, enter
information.001
. - Beneath Questions/Utterances, enter
Need to study extra about Amazon Lex
. - Beneath Reply, enter the next reply:
- Develop the Superior part and enter the identical reply below Markdown Reply.
- Depart the remaining as default, and select Create to avoid wasting the query.
Create information query 3
Full the next steps so as to add one other information query:
- Select Add so as to add a brand new query.
- Choose qna.
- For Merchandise ID, enter
password.reset
. - Beneath Questions/Utterances, enter I must reset my password.
- Beneath Reply, enter the next reply:
- Develop the Superior part and enter the identical textual content for Markdown Reply.
- Select Create to avoid wasting the query.
Create a response bot
Full the next steps to create the primary response bot, which elicits a response:
- Select Add so as to add a brand new query.
- Choose qna.
- For Merchandise ID, enter
ElicitResponse.001
. - Beneath Questions/Utterances, enter
Please create a ticket
. - Beneath Reply, enter the next reply:
- Develop the Superior part and navigate to the Elicit Response part.
- For Elicit Response: ResponseBot Hook, enter
QNAFreeText
. - For Elicit Response: Response Session Attribute Namespace, enter
short_description
.
This creates a slot named short_description
that captures the response or description for the incident. This slot makes use of the built-in QNAFreeText, which is used for capturing free textual content.
- For Doc Chaining: Chaining Rule, enter
QID::merchandise.002
. This have to be in single quotes. Keep in mind this chaining rule to make use of when creating your doc chain. - Depart the remaining as default.
- Select Create to avoid wasting the query.
Create a doc chain
Now we create a doc chain in QnABot that can set off the Lambda perform to create a ticket and reply with a ticket quantity. Doc chaining lets you chain two bots based mostly on the rule you configured. Full the next steps:
- Select Add so as to add a brand new query.
- Choose qna.
- For Merchandise ID, enter
merchandise.002
. This could match the QID worth given within the doc chain rule earlier. - Beneath Questions/Utterances, enter
servicenow integration
. - Beneath Reply, enter the next reply:
- Within the Superior part, add the Lambda perform ARN for Lambda Hook.
- Select Create to avoid wasting the query.
Take a look at the QnABot
To check the QnABot default consumer, full the next steps:
- Select the choices menu within the Content material Designer and select QnABot Shopper.
The QnABot consumer will open in a brand new browser tab.
- Log in utilizing the newly created person credentials to start the check.
Should you plan to make use of the Amazon Lex Internet UI on a static web page, observe these directions.
- Select the chat icon on the backside of the web page to start out the chat.
- To log in, select Login on the menu.
You may be routed to the login web page.
- Present the
userId
created earlier. - For first-time logins, you may be prompted to reset your password.
- Now we will check the chatbot with instance use circumstances. For our first use case, we need to find out about Amazon and enter the query “I need to find out about Amazon Lex, are you able to give me some details about it?” QnABot offers a video and a few hyperlinks to sources.
- In our subsequent, instance, we have to set up software program on our laptop computer, and ask “Are you able to give me directions to put in software program.” QnABot understands that the person is requesting assist putting in software program and offers solutions from the information financial institution. You’ll be able to observe these directions and set up the software program you want.
- Whereas putting in the software program, what when you locked your password attributable to a number of failed login makes an attempt? To request a password reset, you’ll be able to ask “I must reset my password.”
- You may want further help resetting the password and need to create a ticket. On this case, enter “Please create a ticket.” QnABot asks for an outline of the issue; you’ll be able to enter “reset password.” QnAbot creates a ticket with the outline supplied and offers the ticket quantity as a part of the response.
- You’ll be able to confirm the incident ticket was created on the ServiceNow console below Incidents. If the ticket shouldn’t be proven on the primary web page, seek for the ticket quantity utilizing the search toolbar.
Clear up
To keep away from incurring future costs, delete the sources you created. For directions to uninstall the QnABot answer plugin, discuss with Uninstall the solution.
Conclusion
Integrating QnABot on AWS with ServiceNow offers an end-to-end answer for automated buyer help. With QnABot’s conversational AI capabilities to grasp buyer questions and ServiceNow’s strong incident administration options, corporations can streamline ticket creation and backbone. It’s also possible to lengthen this answer to indicate a listing of tickets created by the person. For extra details about incorporating these methods into your bots, see QnABot on AWS.
Concerning the Authors
Sujatha Dantuluri is a Senior Options Architect within the US federal civilian group at AWS. She has over 20 years of expertise supporting business and federal authorities. She works carefully with prospects in constructing and architecting mission-critical options. She has additionally contributed to IEEE requirements.
Maia Haile is a Options Architect at Amazon Internet Companies based mostly within the Washington, D.C. space. In that function, she helps public sector prospects obtain their mission aims with well-architected options on AWS. She has 5 years of expertise spanning nonprofit healthcare, media and leisure, and retail. Her ardour is utilizing AI and ML to assist public sector prospects obtain their enterprise and technical objectives.