> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-process-dev.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring the ServiceNow Agent - Tokyo and Lower Versions

The ServiceNow Agent integration allows you to hand off AI Agent conversations to live agents on ServiceNow. This guide covers configuration for **Tokyo** and lower versions.

***

## Configuration Steps

* [Step 1: Retrieve the ServiceNow Instance URL](#step-1-retrieve-the-servicenow-instance-url)
* [Step 2: Create a New Queue](#step-2-create-a-new-queue)
* [Step 3: Enable the ServiceNow Agent](#step-3-enable-the-servicenow-agent)
* [Step 4: Switch to UI16 Theme](#step-4-switch-to-ui16-theme)
* [Step 5: Install Required Plugins](#step-5-install-the-required-plugins)
* [Step 6: Create a User with agent\_admin Role](#step-6-create-a-user-with-agent_admin-role)
* [Step 7: Create a Group and Add the User](#step-7-create-a-group-and-add-the-user-created-to-the-group)
* [Step 8: Define the Host URL in the REST Message](#step-8-define-the-host-url-in-the-rest-message-in-servicenow)
* [Step 9: Define Outbound REST Message Requests](#step-9-define-outbound-rest-message-requests-in-servicenow)
* [Step 10: Define Outbound REST Business Rules](#step-10-define-outbound-rest-business-rules-in-servicenow)
* [Step 11: Testing Configuration](#step-11-testing-configuration)

***

### Step 1: Retrieve the ServiceNow Instance URL

1. Log in to your ServiceNow account with admin credentials. The URL format is: `https://devXXX67.service-now.com`.
2. Copy the Instance URL for use in Step 3.

### Step 2: Create a New Queue

1. Log in to your ServiceNow account.

2. Navigate to **Connect > Support Administration > Queues** and click **New**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img1.png" alt="Create new queue" />

3. Enter the queue **Name** and select **Consumer Service Support** in the **Assignment group** field.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img2.png" alt="Queue details" />

4. In the **Chat Queue Entries** section, click **New** and assign a user.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img3.png" alt="Assign chat queue entry" />

5. Click **Submit** to save the queue entry, then **Submit** again to save the queue.

6. Copy the **Queue ID**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img4.png" alt="Queue ID" />

### Step 3: Enable the ServiceNow Agent

1. Log in to the Platform.

2. Select the AI Agent to configure.

3. Navigate to **App Settings > Integrations > Agent Transfer** and click **ServiceNow**.

4. On the **Configurations** tab, choose an authentication method:

   **Option 1: Basic Auth**

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img6.png" alt="Basic Auth" />

   1. Select **Connect Support (Supported for Tokyo and lower versions)**.
   2. Select **Basic Auth**.
   3. Enter:

      | Field        | Description                                                        |
      | ------------ | ------------------------------------------------------------------ |
      | Instance URL | ServiceNow instance URL (e.g., `https://devXXX67.service-now.com`) |
      | User Name    | ServiceNow account username                                        |
      | Password     | ServiceNow account password                                        |
      | Queue ID     | Queue ID from Step 2                                               |
      | Webhook URL  | Web URL for custom application function callbacks                  |

   **Option 2: OAuth with Refresh Token**

   Follow [this ServiceNow documentation](https://support.servicenow.com/kb?id=kb_article_view\&sysparm_article=KB0778194) to generate a refresh token.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img7.png" alt="OAuth with Refresh Token" />

   1. Select **Connect Support (Supported for Tokyo and lower versions)**.
   2. Select **OAuth with Refresh Token**.
   3. Enter:

      | Field         | Description                                       |
      | ------------- | ------------------------------------------------- |
      | Instance URL  | ServiceNow instance URL                           |
      | Client ID     | Client ID from your ServiceNow application        |
      | Client Secret | Client secret from your ServiceNow application    |
      | Refresh Token | Refresh token generated per the documentation     |
      | Webhook URL   | Web URL for custom application function callbacks |

5. Click **Authorize** to authenticate.

6. To make ServiceNow the default agent, enable **Default Agent System for all app channels**.

   <Note>This option is enabled only when multiple agents are configured.</Note>

7. Click **Configure** to map channels.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img8.png" alt="Customize channel mapping" />

8. Select channels to map to the ServiceNow agent.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img9.png" alt="Map channels" />

9. Click **Done**, then **Save**.

10. Publish the app. See [Publishing your App](/ai-for-service/deployment/publishing-app).

### Step 4: Switch to UI16 Theme

1. Log in to ServiceNow with admin credentials.

2. Navigate to **System Properties** and click **New**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img10.png" alt="System Properties" />

3. Enter the property `glide.ui.polaris.on_off_user_pref_enabled`, set type to `true|false`, and click **Submit**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img11.png" alt="Property configuration" />

   <Note>This property allows toggling between "Next experience and UI16" and classic experience.</Note>

4. Click the **System Admin** profile and select **Preferences**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img12.png" alt="Preferences menu" />

5. Enable **Turn off Next experience**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img13.png" alt="Turn off Next experience" />

6. The view switches to UI16 theme.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img14.png" alt="UI16 theme" />

### Step 5: Install the Required Plugins

1. Log in to the ServiceNow Developer instance with admin credentials.

2. Navigate to **System Definition > Plugins** from the left menu.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img15.png" alt="Plugins - System Definition" />

3. Search for and install the **Consumer Service Portal** plugin.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img16.png" alt="Consumer Service Portal plugin" />

4. After installation, the **Connect support** menu item appears in the left navigation.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img17.png" alt="Connect support menu item" />

### Step 6: Create a User with agent\_admin Role

1. Log in to the ServiceNow instance with admin credentials.

2. Navigate to **User Administration > Users > New**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img18.png" alt="Users - New" />

3. Fill in the user details and click **Submit**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img19.png" alt="New user details" />

4. Select the **Roles** tab and click **Edit**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img20.png" alt="Roles tab" />

5. Search for and add the **agent\_admin** role to the user.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img21.png" alt="Add agent_admin role" />

6. Click **Save**.

### Step 7: Create a Group and Add the User

1. Navigate to **User Administration > Groups**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img22.png" alt="User Administration - Groups" />

2. Click **New**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img23.png" alt="Groups - New" />

3. Fill in the group details and click **Submit**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img24.png" alt="Group details" />

4. Edit the group, scroll to the **Group Members** tab, and click **Edit**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img25.png" alt="Edit group members" />

5. Select the agent from Step 6 and add them to the group.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img26.png" alt="Add agent to group" />

6. Click **Save**.

### Step 8: Define the Host URL in the REST Message

1. Log in to your ServiceNow account.

2. Navigate to **System Web Services > Outbound > REST Messages** from the left menu.

3. Click **New** to create a new REST Message.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img27.png" alt="REST Messages - New" />

4. Copy the **Webhook URL** from the Platform AI Agent configuration page and paste it into the **Endpoint URL** field.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img28.png" alt="Endpoint URL" />

5. Click **Save**.

### Step 9: Define Outbound REST Message Requests

1. Navigate to **System Web Services > Outbound > REST Messages**.

2. Select the REST Message for Platform agent integrations (e.g., `Platform - Agent Integrations`).

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img29.png" alt="Select REST Message" />

3. Enter the API details including the endpoint URL (Callback URL from the Configurations page) and HTTP method.

   <Note>This endpoint is how ServiceNow sends agent messages to the user.</Note>

4. Click the **HTTP Request** tab and select **Add New Row**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img30.png" alt="HTTP Request - Add new row" />

5. Add:

   * **HTTP Header**: `Content-Type: application/json`
   * **Method**: `POST` — paste the Webhook URL in the Endpoint field.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img31.png" alt="HTTP Request - Add header" />

6. Click **Update**.

### Step 10: Define Outbound REST Business Rules

1. Navigate to **System Definition > Business Rules**.

2. Click **New**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img32.png" alt="Business Rule - New" />

3. Enter the following details:

   * **Name**: Enter a name.
   * **Table**: Select `live_message`.
   * Enable **Active** and **Advanced** checkboxes.
   * In the **When to run** tab: set **When** to `after` and select **Insert**.
   * Add **Filter conditions**: execute if `created by` is not `AI Agent_interface`.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img33.png" alt="Add filter conditions" />

4. On the **Advanced** tab, add the following code and click **Submit**:

   ```javascript  theme={null}
   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>This code is optional. Use it if you encounter issues during execution. This business rule executes the API configured in the REST Message.</Note>

### Step 11: Testing Configuration

1. Open the AI Agent with ServiceNow enabled.

2. Create an Agent Transfer Node task (e.g., `Platform Agent` with a `UserAgent` node). See [Agent Transfer Node](/ai-for-service/automation/dialogs/node-types/agent-transfer-node).

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img34.png" alt="Agent Transfer Node task" />

3. Click **Talk to Bot** and enter **Help**.

4. Log in to ServiceNow, go to **Profile**, and select **Impersonate User**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img35.png" alt="Impersonate user" />

5. Select the username created (e.g., `Abel Tuter`).

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img36.png" alt="Provide username" />

6. Navigate to **Workspace Experience > Workspaces > Agent Workspace Home**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img37.png" alt="Agent Workspace Home" />

7. In the Agent Workspace, select **Inbox** and set **Status** to **Available**.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img38.png" alt="Set inbox status to Available" />

8. When the user initiates chat, the conversation transfers to the ServiceNow agent and the connection is established.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/configuring-the-servicenow-agent-tokyo-img39.png" alt="Connection established" />

***

## Additional Capabilities

### Enable Attachment Sharing with Live Agents

1. Log in to ServiceNow with admin credentials.
2. Navigate to **System Properties > sys\_cs\_provider\_application.list > Configure > Form Layout**.
3. In the **Trusted Media Domains** field, enter the domain for sending and receiving attachments.

   <img src="https://mintlify.s3.us-west-1.amazonaws.com/koreai-ai-for-process-dev/ai-for-service/integrations/agents/images/sn-at.png" alt="Attachment Sharing" />

   <Note>This feature supports only Tokyo versions.</Note>

### Agent Transfer Status

The platform records agent transfer status in Debug Logs and Analytics, enabling tracking and troubleshooting of transfer-related issues.

### Failed Agent Transfer Notification

When a ServiceNow agent transfer fails due to agent unavailability, users see a default non-editable message:

*No agents are available to handle your request. Please try again later.*


Built with [Mintlify](https://mintlify.com).