---
title: "Create Teams group chats from records"
site: admin
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/admin/2027.1/integrations/teams/group-chats/
type: task
application: integration_microsoft_teams
last_updated: 2026-12-03
commit: 6777698daac5
---


Set up group chats when agents should pull the people on a record into one Microsoft Teams chat, such as a major incident bridge. Agents then create the chat from the record, open it later and export a summary of it to a field on the record.

## Before you begin

- You need the `administrator` role.
- Complete [Register an Azure bot](page:integrations/teams/register-an-azure-bot). Chats are created through the default **Microsoft Teams** messaging account.
- Grant the bot's app registration Microsoft Graph application permissions, with admin consent, for the three calls Servicely makes:
  - `Chat.Create` to create the chat.
  - `TeamsTab.Create` to add a website tab that opens the record. Without it the chat is still created, without the tab.
  - A permission to read the chat's messages, for the export. Microsoft lists `ChatMessage.Read.Chat`, `Chat.Read.All` and `Chat.ReadWrite.All` for this call. `Chat.Read.All` and `Chat.ReadWrite.All` cover every chat in the tenant, so choose with your Microsoft 365 administrator.
- Know the table, the user reference fields that hold the chat members and the field that receives the exported summary.

## Steps

<Steps>
  <Step>
    Go to **Messaging & notifications → Accounts & channels → All messaging channel integrations**. Open the shipped record "Incident - Major Incident chat", or select **New** for another table.

    <Image src="asset:screenshots/admin/integrations-teams-group-chats/nav-channel-integrations.png">The All messaging channel integrations item in the Accounts & channels menu.</Image>
  </Step>
  <Step>
    Fill in the fields in the table below and save. Each table can have only one record.

    <Image src="asset:screenshots/admin/integrations-teams-group-chats/major-incident-chat.png">The shipped Incident - Major Incident chat record.</Image>
  </Step>
  <Step>
    For Incident, go to **Scripting & automation → Scripts → Table operations** and activate "Incident - Create Teams Major Incident Chat". It ships inactive. "Incident - View Teams Major Incident Chat" and "Incident - Export Teams Major Incident Chat messages" ship active.
  </Step>
  <Step>
    For another table, create three table operations on it with **Operation type** set to **Execute on client**. Each calls the `servicely.core.MsTeamsChat` controller with a different method: `createChat`, `getChat` or `exportChatToField`. The script for creating a chat follows these steps.
  </Step>
  <Step>
    Set a **Condition** on each operation so it shows only where it applies. The shipped Incident operations show on saved major incidents outside the self-service view, to users with the matching roles.
  </Step>
</Steps>

```javascript
RequestFactory.createRequest()
    .controller("servicely.core.MsTeamsChat")
    .method("createChat")
    .data({
        parentTable: tableName,
        parentId: current.getID()
    })
    .successFunc(function (response) {
        window.open(response.data.url);
    })
    .execute();
```

| Field | Shipped value for Incident | Purpose |
| --- | --- | --- |
| **Name** | Incident - Major Incident chat | Identifies the record |
| **Table** | Incident | The table whose records get chats |
| **Chat name** | `Major Incident - ${current.Number()} - ${current.ShortDescription()}` | The chat's title in Teams. `${current.FIELD()}` inserts a field value. |
| **Members** | `MajorIncidentManager`, `MajorIncidentFollower` | User reference fields whose users join the chat |
| **Roles to Create** | `itsm_agent` | Who can create the chat |
| **Roles to View** | `itsm_agent` | Who can open the chat from the record |
| **Roles to Export** | `itsm_agent` | Who can export the chat to the record |
| **Messages Export Field** | `WorkJournal` | The field that receives the summary |
| **Summarization Prompt** | The shipped summarisation prompt | The AI prompt that turns the chat into a summary |

## Result

On a qualifying record, an agent with a create role sees the create operation. Selecting it creates the Teams chat with the members and opens it in a new tab. Each record has one chat, so the view operation then replaces the create operation. Export runs the summarisation prompt over the chat and writes the summary to the export field, as HTML for journal and HTML fields and Markdown otherwise. Administrators can use all three operations whatever their roles.

## Related

- [Register an Azure bot](page:integrations/teams/register-an-azure-bot)
- [Table operations](page:automation/scripts/table-operations)
- [Send notifications to Microsoft Teams](page:integrations/teams/connect-notifications)
