This post is co-written with Sujith R Pillai from Kyndryl.
In this post, we show you how Kyndryl, an AWS Premier Tier Services Partner and IT infrastructure services provider that designs, builds, manages, and modernizes complex, mission-critical information systems, integrated Amazon Q Business with ServiceNow in a few simple steps. You will learn how to configure Amazon Q Business and ServiceNow, how to create a generative AI plugin for your ServiceNow incidents, and how to test and interact with ServiceNow using the Amazon Q Business web experience. By the end of this post, you will be able to enhance your ServiceNow experience with Amazon Q Business and enjoy the benefits of a generative AI–powered interface.
Solution overview
Amazon Q Business has three main components: a front-end chat interface, a data source connector and retriever, and a ServiceNow plugin. Amazon Q Business uses AWS Secrets Manager secrets to store the ServiceNow credentials securely. The following diagram shows the architecture for the solution.
Chat
Users interact with ServiceNow through the generative AI–powered chat interface using natural language.
Data source connector and retriever
A data source connector is a mechanism for integrating and synchronizing data from multiple repositories into one container index. Amazon Q Business has two types of retrievers: native retrievers and existing retrievers using Amazon Kendra. The native retrievers support a wide range of Amazon Q Business connectors, including ServiceNow. The existing retriever option is for those who already have an Amazon Kendra retriever and would like to use that for their Amazon Q Business application. For the ServiceNow integration, we use the native retriever.
ServiceNow plugin
Amazon Q Business provides a plugin feature for performing actions such as creating incidents in ServiceNow.
The following high-level steps show how to configure the Amazon Q Business – ServiceNow integration:
- Create a user in ServiceNow for Amazon Q Business to communicate with ServiceNow
- Create knowledge base articles in ServiceNow if they do not exist already
- Create an Amazon Q Business application and configure the ServiceNow data source and retriever in Amazon Q Business
- Synchronize the data source
- Create a ServiceNow plugin in Amazon Q Business
Prerequisites
To run this application, you must have an Amazon Web Services (AWS) account, an AWS Identity and Access Management (IAM) role, and a user that can create and manage the required resources. If you are not an AWS account holder, see How do I create and activate a new Amazon Web Services account?
You need an AWS IAM Identity Center set up in the AWS Organizations organizational unit (OU) or AWS account in which you are building the Amazon Q Business application. You should have a user or group created in IAM Identity Center. You will assign this user or group to the Amazon Q Business application during the application creation process. For guidance, refer to Manage identities in IAM Identity Center.
You also need a ServiceNow user with incident_manager
and knowledge_admin
permissions to create and view knowledge base articles and to create incidents. We use a developer instance of ServiceNow for this post as an example. You can find out how to get the developer instance in Personal Developer Instances.
Solution walkthrough
To integrate ServiceNow and Amazon Q Business, use the steps in the following sections.
Create a knowledge base article
Follow these steps to create a knowledge base article:
- Sign in to ServiceNow and navigate to Self-Service > Knowledge
- Choose Create an Article
- On the Create new article page, select a knowledge base and choose a category. Optionally, you may create a new category.
- Provide a Short description and type in the Article body
- Choose Submit to create the article, as shown in the following screenshot
Repeat these steps to create a couple of knowledge base articles. In this example, we created a hypothetical enterprise named Example Corp for demonstration purposes.
Create an Amazon Q Business application
Amazon Q offers three subscription plans: Amazon Q Business Lite, Amazon Q Business Pro, and Amazon Q Developer Pro. Read the Amazon Q Documentation for more details. For this example, we used Amazon Q Business Lite.
Create application
Follow these steps to create an application:
- In the Amazon Q Business console, choose Get started, then choose Create application to create a new Amazon Q Business application, as shown in the following screenshot
- Name your application in Application name. In Service access, select Create and use a new service-linked role (SLR). For more information about example service roles, see IAM roles for Amazon Q Business. For information on service-linked roles, including how to manage them, see Using service-linked roles for Amazon Q Business. We named our application ServiceNow-Helpdesk. Next, select Create, as shown in the following screenshot.
Choose a retriever and index provisioning
To choose a retriever and index provisioning, follow these steps in the Select retriever screen, as shown in the following screenshot:
- For Retrievers, select Use native retriever
- For Index provisioning, choose Starter
- Choose Next
Connect data sources
Amazon Q Business has ready-made connectors for common data sources and business systems.
- Enter “ServiceNow” to search and select ServiceNow Online as the data source, as shown in the following screenshot
- Enter the URL and the version of your ServiceNow instance. We used the ServiceNow version Vancouver for this post.
- Scroll down the page to provide additional details about the data source. Under Authentication, select Basic authentication. Under AWS Secrets Manager secret, select Create and add a new secret from the dropdown menu as shown in the screenshot.
- Provide the Username and Password you created in ServiceNow to create an AWS Secrets Manager secret. Choose Save.
- Under Configure VPC and security group, keep the setting as No VPC because you will be connecting to the ServiceNow by the internet. You may choose to create a new service role under IAM role. This will create a role specifically for this application.
- In the example, we synchronize the ServiceNow knowledge base articles and incidents. Provide the information as shown in the following image below. Notice that for Filter query the example shows the following code.
This filter query aims to sync the articles that meet the following criteria:
- workflow_state = published
- kb_knowledge_base = dfc19531bf2021003f07e2c1ac0739ab (This is the default Sys ID for the knowledge base named “Knowledge” in ServiceNow).
- Type = text (This field contains the text in the Knowledge article).
- Active = true (This field filters the articles to sync only the ones that are active).
The filter fields are separated by ^, and the end of the query is represented by EQ. You can find more details about the Filter query and other parameters in Connecting Amazon Q Business to ServiceNow Online using the console.
- Provide the Sync scope for the Incidents, as shown in the following screenshot
- You may select Full sync initially so that a complete synchronization is performed. You need to select the frequency of the synchronization as well. For this post, we chose Run on demand. If you need to keep the knowledge base and incident data more up-to-date with the ServiceNow instance, choose a shorter window.
- A field mapping will be provided for you to validate. You won’t be able to change the field mapping at this stage. Choose Add data source to proceed.
This completes the data source configuration for Amazon Q Business. The configuration takes a few minutes to be completed. Watch the screen for any errors and updates. Once the data source is created, you will be greeted with a message You successfully created the following data source: ‘ServiceNow-Datasource’
Add users and groups
Follow these steps to add users and groups:
- Choose Next
- In the Add groups and users page, click Add groups and users. You will be presented with the option of Add and assign new users or Assign existing users and groups. Select Assign existing users and groups. Choose Next, as shown in the following image.
- Search for an existing user or group in your IAM Identity Center, select one, and choose Assign. After selecting the right user or group, choose Done.
This completes the activity of assigning the user and group access to the Amazon Q Business application.
Create a web experience
Follow these steps to create a web experience in the Add groups and users screen, as shown in the following screenshot.
- Choose Create and use a new service role in the Web experience service access section
- Choose Create application
The deployed application with the application status will be shown in the Amazon Q Business > Applications console as shown in the following screenshot.
Synchronize the data source
Once the data source is configured successfully, it’s time to start the synchronization. To begin this process, the ServiceNow fields that require synchronization must be updated. Because we intend to get answers from the knowledge base content, the text field needs to be synchronized. To do so, follow these steps:
- In the Amazon Q Business console, select Applications in the navigation pane
- Select ServiceNow-Helpdesk and then ServiceNow-Datasource
- Choose Actions. From the dropdown, choose Edit, as shown in the following screenshot.
- Scroll down to the bottom of the page to the Field mappings Select text and description.
- Choose Update. After the update, choose Sync now.
The synchronization takes a few minutes to complete depending on the amount of data to be synchronized. Make sure that the Status is Completed, as shown in the following screenshot, before proceeding further. If you notice any error, you can choose the error hyperlink. The error hyperlink will take you to Amazon CloudWatch Logs to examining the logs for further troubleshooting.
Create ServiceNow plugin
A ServiceNow plugin in Amazon Q Business helps you create incidents in ServiceNow through Amazon Q Business chat. To create one, follow these steps:
- In the Amazon Q Business console, select Enhancements from the navigation pane
- Under Plugins, choose Add plugin, as shown in the following screenshot
- In the Add Plugin page, shown in the following screenshot, and select the ServiceNow plugin
- Provide a Name for the plugin
- Enter the ServiceNow URL and use the previously created AWS Secrets Manager secret for the Authentication
- Select Create and use a new service role
- Choose Add plugin
- The status of the plugin will be shown in the Plugins If Plugin status is Active, the plugin is configured and ready to use.
Use the Amazon Q Business chat interface
To use the Amazon Q Business chat interface, follow these steps:
- In the Amazon Q Business console, choose Applications from the navigation pane. The web experience URL will be provided for each Amazon Q Business application.
- Choose the Web experience URL to open the chat interface. Enter an IAM Identity Center username and password that was assigned to this application. The following screenshot shows the Sign in
You can now ask questions and receive responses, as shown in the following image. The answers will be specific to your organization and are retrieved from the knowledge base in ServiceNow.
You can ask the chat interface to create incidents as shown in the next screenshot.
A new pop-up window will appear, providing additional information related to the incident. In this window, you can provide more information related to the ticket and choose Create.
This will create a ServiceNow incident using the web experience of Amazon Q Business without signing in to ServiceNow. You may verify the ticket in the ServiceNow console as shown in the next screenshot.
Conclusion
In this post, we showed how Kyndryl is using Amazon Q Business to enable natural language conversations with ServiceNow using the ServiceNow connector provided by Amazon Q Business. We also showed how to create a ServiceNow plugin that allows users to create incidents in ServiceNow directly from the Amazon Q Business chat interface. We hope that this tutorial will help you take advantage of the power of Amazon Q Business for your ServiceNow needs.
About the authors
Asif Fouzi is a Principal Solutions Architect leading a team of seasoned technologists supporting Global Service Integrators (GSI) such as Kyndryl in their cloud journey. When he is not innovating on behalf of users, he likes to play guitar, travel, and spend time with his family.
Sujith R Pillai is a cloud solution architect in the Cloud Center of Excellence at Kyndryl with extensive experience in infrastructure architecture and implementation across various industries. With his strong background in cloud solutions, he has led multiple technology transformation projects for Kyndryl customers.