--- title: "Tutorial: Post Message to Slack when External Event Occurs using Real-Time Rules" slug: "tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules" updated: 2026-11-23T12:31:35Z published: 2026-11-23T12:31:35Z canonical: "support.gainsight.com/tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.gainsight.com/llms.txt > Use this file to discover all available pages before exploring further. # Tutorial: Post Message to Slack when External Event Occurs using Real-Time Rules Gainsight NXT This article explains how to post in Slack when an external event occurs using Gainsight data. ## Introduction Using the **Call External API** action type in Real-Time Rules, configure a rule to post a message in the Slack channel immediately when an urgent ticket is created in FreshdeskTM (which is an external system) for high revenue customers. For more information on the Real-Time Rules feature, refer to the [*Real-Time Rules*](/v1/docs/real-time-rules) article. This tutorial has four sections: - [Configure External Events](/v1/docs/tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules#configure-external-events) - [Configure Custom Connector](/v1/docs/tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules#configure-custom-connector) - [Setup External Action](/v1/docs/tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules#setup-external-action) - [Configure Call External API Action](/v1/docs/tutorial-post-message-to-slack-when-external-event-occurs-using-real-time-rules#configure-call-external-api-action) ## Configure External Events From FreshdeskTM, configure a rule using Webhook such that when a ticket status is updated to *Urgent* call Gainsight. For more information on how to configure external events, refer to the [*Events Framework*](/v1/docs/events-framework-1) article. To capture the ticket status update to Urgent in Events Framework: 1. Navigate to the **Administration > Events** page. 2. In the **TOPICS** tab, click **+Create New Topic**. 3. Create a topic with the name *FreshDeskTM Demo (sample)*. For more information, refer to the *Create a Topic* section in the [*Events Framework*](/v1/docs/events-framework-1#create-a-topic) article. 4. In the **EVENTS** tab, create an event with the name *Urgent Priority* under the FreshdeskTM demo topic. 5. In the **Structure** section, click **+ Add New** and add the same fields used in creating a webhook in FreshdeskTM. Refer to the video below: [Embedded content](https://player.vimeo.com/video/485910516) 6. Select the **Resolve event fields** checkbox to view all the Company fields in Real-Time Rules. 7. From the **Resolve to** drop-down, select *Company* and map the *Company Name* event field to the *Name* object field. 8. Click **Save**. ![EF1.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/EF1(1).png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=m9IYDZT22I3KzKFWxCwTJdqsEsq5Epl8jCOdNwL%2FSaY%3D) ## Configure Custom Connector You must first configure a connection with Slack. For more information on how to configure a custom connector in Gainsight, refer to the [*Configure Custom Connectors*](/v1/docs/configure-external-action-from-gainsight-1#configure-custom-connectors) article. ## Setup External Action This section explains how to create an action for the external connection created in the previous section. To access the External Actions page: 1. Navigate to **Administration** > **External Actions**. 2. Click **Create Action**. The *Create Action* page appears. 3. In the **Basic Information** section: ![EA1-Tut3.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/EA1-Tut3.png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=sAb7s%2FaWW3Qvgg3BiXdy7SP4t4g5l%2BLI9k4rf0MiD4Y%3D) 1. From the **Select a Connector** drop-down, select the *Slack* Connection created in the previous section 2. In the **Action Name** field, enter a name (Post to Slack Tutorial) for the action 3. Enter the **POST** URL of the Slack Channel to which you wish to post a message. The URL shown below is for a test FreshdeskTM account and this would vary for your instance. For more about creating POST URLs in Slack refer to the [*Sending Messages*](https://api.slack.com/messaging/sending) and [*Sending Messages using Incoming Webhooks*](https://api.slack.com/messaging/webhooks) articles in Slack. 4. In the **Payload** section, enter the following API code: ```plaintext {"text": "*An urgent ticket has been created for the Company:{{Company}}* \n _Subject:_ {{subject}}\n _Agent Name:_ {{Agent}}\n _Priority:_ {{priority}}\n _CSM:_ {{CSM}}, *Status:* {{Status}}"  } ``` The above example API code posts messages in Slack with Company Name, Subject, Agent, Priority, CSM, and Status fields. **IMPORTANT:** Ensure that the fields provided in the above API are the same as in the Events Framework configuration. 5. In the **Headers Information** section, by default, the Content-Type: application/JSON value is auto-populated. 6. In the **Fields** section, configure the data type for the fields created in the payload section. 7. In the **Advanced Configuration Information** section, set the value to *3*. 8. Click **Create**. [Embedded content](https://player.vimeo.com/video/485910574) ## Configure Call External API Action This section explains how to configure a Real-Time rule to sync post a slack message when an external event occurs. To configure the Real-Time rule: 1. Navigate to **Administration** *>* **Rules Engine** *>* **Real-Time Rules** tab. 2. Click **New Rule**. A new page appears, where you can view the following three tabs: - Details - Configure - Actions ![RTR-CreateRule.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/RTR-CreateRule(1).png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=Tv3J47eIocXX6aapriVjaTTIda6pUzSP3cArigJ%2FnrY%3D) ### Details Tab Enter the following information in the **Details** tab. 1. **Rule Name:** *Post to Slack when* *External Event Occur.* 2. **Select Folder:** Select the folder in which you want to add this rule (or) by default, the rule is saved to the *Uncategorized* folder. 3. (Optional) **Description**: Provide a brief description of the rule. 4. Click **Configure** to update the rule details, and navigate to the **Configure** tab. ![Details Tab-Tut3.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Details_Tab-Tut3.png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=%2Fq%2Fiw2rfVu3oJkVfOhDYLKgXxGxVLuxyBAYCu4CBcKk%3D) ### Configure Tab To configure a Rule for high revenue customers: 1. In the **Select an Event** section: 1. From the **Event Topic** drop-down, select the *FreshdeskTM Demo* event configured in the Configure External Events section. 2. From the **Event** drop-down, select *Urgent Priority(1)*. **Note:** All the Company lookup fields are displayed since the company is resolved in Events Framework. 2. In the **Apply Filters** section, drag and drop the **ARR** field and set the value *greater than 100000*. 3. Click **Actions** to update the rule details, and navigate to the **Actions** tab. ![Configure Tab-Tut3.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Configure_Tab-Tut3.png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=p2S7FndX0nQyGSgRsNe86AcqrudYWJx56lXHu0jsE%2Bk%3D) ### Actions Tab To create an Action: 1. Click **Create Action**. 2. Select **Call External API** action type. 3. From the **Connector** drop-down, select *Slack*. 4. From the **External API** drop-down, select *Post to Slack - Tutorial*. 5. In the **Field Mappings** section, map the following **External Action Fields** to **Event Fields**: - *Company - Company Name* - *Subject - Subject* - *Agent - Agent Name* - *Priority - Priority* - *CSM Name - Custom Field* - *Status - Status* 6. Click **Save Rule**. 7. Click **Close**. 8. Turn on the **Status** toggle switch to execute the rule. ![Actions Tab-Tut3-1.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Actions_Tab-Tut3-1.png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=VAlj%2B6a3IXVp6yUA40CIxS9%2FzNAknEdApScpdtCVI7g%3D) When an urgent ticket is created in the external system, External Framework receives an event that triggers the rule. If the rule is successful, a message is posted in the selected Slack channel. ![Actions Tab-Tut3.png](https://cdn.us.document360.io/8e136619-829c-49c5-afb1-72de86f13288/Images/Documentation/Actions_Tab-Tut3.png?sv=2026-02-06&spr=https&st=2026-11-24T17%3A21%3A35Z&se=2026-11-24T18%3A21%3A35Z&sr=b&sp=r&sig=pGwCZhLfN8aJo8gJEQ%2FBhbUZgkg%2BmWGQnUJtAenTGWQ%3D)