Skip to Content

Send a Microsoft Teams notification from a Studio operation in Jitterbit Studio

Introduction

This integration design pattern sends a formatted message to a Microsoft Teams channel from a Studio operation. The operation uses the Microsoft Teams connector to post a message to a specific team and channel via the Microsoft Graph API. This pattern is commonly used to notify a team when a significant event occurs, such as a new order being received, a record being created, or an operation completing with errors.

Before configuring the connector, you must complete the Microsoft Teams prerequisites, which require an Azure App registration in Microsoft Entra ID.

Design pattern

The Studio operation follows the transformation pattern:

flowchart LR A[Source activity] --> B[Transformation] --> C[Send Message activity]

The source activity provides the data used to build the message (for example, a database query result, a Salesforce record, or a script output). The transformation constructs the message text. The Microsoft Teams Send Message activity posts the message to the selected team and channel.

Part 1: Complete the prerequisites

The Microsoft Teams connector authenticates using OAuth 2.0, which requires an app registration in Microsoft Entra ID (formerly Azure Active Directory).

Follow the steps in Microsoft Teams prerequisites to:

  1. Register an application in the Microsoft Entra ID portal and record the Application (client) ID and Directory (tenant) ID.

  2. Create a client secret for the application and record its value. The value is visible only when it is first created.

  3. Grant the required Microsoft Graph API permissions and click Grant admin consent.

Keep the tenant ID, client ID, client secret value, and your Microsoft Entra ID username and password available for the connection configuration.

Part 2: Configure the Microsoft Teams connection

  1. In Studio, open your project and click the Project endpoints and connectors tab in the design component palette.

  2. Click the Microsoft Teams connector to open the connection configuration.

  3. Connection Name: Enter a name such as Microsoft Teams.

  4. Tenant ID: Enter the Directory (tenant) ID from your Microsoft Entra ID app registration.

  5. Client ID: Enter the Application (client) ID from your app registration.

  6. Client Secret: Enter the client secret value from your app registration.

    Tip

    Store the client secret, username, and password as project variables with their values hidden. This keeps sensitive credentials out of the connection configuration directly and makes them easier to rotate without editing the project.

  7. Username: Enter the username you use to sign in to Microsoft Entra ID.

  8. Password: Enter the password for that account.

  9. Click Test, then click Save Changes.

Part 3: Configure the Send Message activity

  1. On the design component palette, expand the Microsoft Teams endpoint and drag the Send Message activity type onto the design canvas.

  2. Double-click the activity to open its configuration.

Step 1: Enter a name and select a team

  1. Name: Enter a name such as Post Teams Notification.

  2. In the Select a Team table, click a row to select the team that contains the target channel. The table is populated from the Microsoft Teams endpoint. If the table is empty, verify that the connection test was successful.

  3. Click Next.

Step 2: Select a channel

  1. In the Select a Channel table, click a row to select the channel to post to. The table shows channels for the team selected in the previous step.

  2. Optional Settings: If you want to send HTML-formatted messages rather than plain text, expand Optional Settings and select Content Type: 'HTML'.

  3. Click Next.

Step 3: Review the data schemas

The connector generates request and response schemas from the Microsoft Teams endpoint. Review them and click Finished.

The request schema contains the following fields under sendMessageRequest:

  • message: The text content of the message. Required.
  • contentType: The content type of the message. This field is populated automatically based on the Content Type: 'HTML' setting in the previous step.
  • attachment: An optional object for attaching a file, containing fileName and fileData fields. Files larger than 4 MB will cause the operation to fail.

Part 4: Map the message in a transformation

In the transformation that precedes the Send Message activity, map the message field of the request schema to a script that constructs the message string.

For example, to send a notification about a new order, the transformation script for sendMessageRequest/message might be:

<trans>
"New order #" + $order_id + " received from " + $customer_name + " for $" + $order_total
</trans>

Where order_id, customer_name, and order_total are global variables populated by a preceding script or mapped from the source activity.

Tip

To include a line break in a plain text message, use "\n" in the script string. If you selected Content Type: 'HTML', use the <br> tag instead.

Verify the integration

Deploy and run the operation to test the notification. Check the operation logs to confirm the Send Message activity completed without errors. If the message does not appear in the Teams channel, verify that the correct team and channel were selected in the activity configuration and that admin consent was granted for all required API permissions.