> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Wecom Alert Integration

> Generate a unique Wecom robot address in Flashduty, and synchronize the occurrence and recovery of alerts through Wecom

Generate a unique Wecom robot address in Flashduty, and synchronize the occurrence and recovery of alerts through Wecom.

<div class="hide">
  ## Operation Steps

  ***

  ### Create Wecom Alert Integration

  You can obtain a Wecom alert integration address through either of these two methods:

  #### Using Dedicated Integration

  Choose this method when you don't need to route alert events to different channels. It's simpler and recommended.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Channel**, and enter a specific channel's details page
    2. Select the **Integration** tab, click **Add Integration** to enter the integration page
    3. Choose **Wecom Alert** integration and click **Save** to generate a card
    4. Click the generated card to view the **Wecom Alert Integration URL**, copy it for later use, and you're done
  </details>

  #### Using Shared Integration

  Choose this method when you need to route alerts to different channels based on the alert event's payload information.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Integration Center => Alert Events** to enter the integration selection page
    2. Select **Wecom Alert** integration:
       * **Integration Name**: Define a name for the current integration
       * **Message Type**: Select Wecom alert message type, currently only Text and Post (rich text) are supported
       * **Push Mode**: Choose when to trigger or recover alerts for Wecom notifications
    3. Copy the **Wecom Alert Integration URL** for later use
    4. Configure the default route and select the corresponding channel (after integration creation, you can go to `Routes` to configure more routing rules)
    5. Done
  </details>
</div>

### Customize Wecom Alert Integration

#### Wecom Alert Integration URL

The system will generate a unique Wecom alert integration URL for you. This URL is compatible with Wecom robot message protocol. When platforms only support Wecom robot channels, you can use this URL to receive corresponding messages.

#### Push Mode

By default, the system always creates new alerts for each message, but you can switch to these modes:

**Trigger or Close Alert Based on Rules**: In this mode, when receiving a new message, the system matches messages according to your rules and triggers new alerts or closes existing alerts based on the matching results.

* You need to fill in at least one **trigger** rule
* You must set up regex extraction rules for Alert Key. The system uses this field to find historical alerts for updates or closure. **If regex extraction fails, the system will use the random to generate an Alert Key** to ensure alerts won't be lost due to configuration errors
* You can choose whether to discard messages when none of the rules match

<Note>
  The regex extraction rule must be a **valid regular expression (RE2 syntax)**: on submit the frontend validates that it compiles, and an illegal regex (such as unsupported syntax) cannot be saved and shows "Please enter a valid regex". Only when the regex is valid but matches nothing does the system fall back to generating a random Alert Key.
</Note>

Configuration example:

* Receive all messages, close the alert when the message content contains **RESOLVED**, otherwise trigger a new alert
* Extract Alert Key from messages using the rule **/(.\*)/**.

#### Silence Detection

In the integration card (edit and preview), the **Silence Detection** (Heartbeat) setting is available below the base settings: if no valid event arrives within the configured interval, the system generates a Warning alert.

| Setting                          | Description                                                                                                                                          |
| :------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Enable Silence Detection**     | Switch, off by default. When on, only upstream events that pass integration validation refresh the detection time                                    |
| **Detection Interval (minutes)** | A Warning alert is generated if no valid event arrives within this interval. Must be an integer between 10 minutes and 48 hours (default 10 minutes) |
| **Auto-recover on new event**    | Switch, on by default. When the next valid event arrives, the alert raised by silence detection is recovered automatically                           |

### Notes

* Wecom alert integration URL only supports Text and Markdown message types; other message types cannot be received
* Flashduty will generate a default alert title: "Wecom robot Alert , If you need to change the title, you can customize it using the [alert pipeline](/en/on-call/integration/alert-integration/alert-pipelines)"

## Severity Mapping

***

Currently, all alerts pushed to Flashduty through the Wecom integration are set to Warning severity. However, you can customize the severity using the [alert pipeline](/en/on-call/integration/alert-integration/alert-pipelines).
