Docs
On this page
task2 min readApplication: Microsoft Teams Integration

Create Teams group chats from records

Let agents open a Microsoft Teams group chat from a record and export a summary of the chat back to the record.

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. 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

  1. Go to Messaging & notifications → Accounts & channels → All messaging channel integrations. Open the shipped record “Incident - Major Incident chat”, or select New for another table.

    The All messaging channel integrations item in the Accounts & channels menu.
  2. Fill in the fields in the table below and save. Each table can have only one record.

    The shipped Incident - Major Incident chat record.
  3. 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.

  4. 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.

  5. 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.

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.

Last updated 3 December 2026commit 6777698daac5Chris Jones
Back to top