Creating a Slack rule and messages

Tags: Flow

Use the Slack integration to configure Slack rules and messages. Find your organization’s rules in your rules table.

Create rules to analyze specific teams or individuals. Create rules to send message when metrics or work patterns change in Flow. These messages can send through a DM or a channel.

Who can use this?



You must have the Manage Slack integration permission in Flow to set up an integration between your organization and Slack workspace. If you don't have this permission, Flow displays a message to request a new app from your Admin.

back to top

Setting up the Slack integration

Connect Slack to your Flow account to add rules and create messages.

To set up the Slack integration in Flow:

  1. In Flow's top navigation, click Settings.
  2. In the left navigation under Report Settings, click Messages.
  3. Under the Slack tab, click Add to Slack.

Removing the Slack integration

To remove your Slack integration, disconnect it via the Slack app store. See the Remove a custom integration section in the Slack help center article Remove apps and custom integrations from your workspace for more information.

back to top

Creating a new rule

Create rules so Flow sends Slack messages when metrics or work patterns change in Flow.

To create a new rule:

  1. In Flow's top navigation, click Settings.
  2. In the left navigation under Report settings, click Messages.
  3. Under the Slack integration tab, click Create rule.
  4. Name a rule.
  5. Select a Slack rule type.
    • Create an individual Slack rule in order to send GitPrime analytics as direct messages to a specified user within Slack.
    • Create a team Slack rule in order to send GitPrime analytics as messages to specified Slack channels.
  6. Click Next.
  7. Configure Flow’s Scope for the rule. Based on your rule type selection, select the user or teams to receive the data in Slack.
    • To select all teams, scroll to the bottom of the teams list and click Select all teams.
    • For each rule type, select one, many, or all repos to pull data from.
    • To select all repos, scroll to the bottom of the repo list and click Select all repos.
  8. Click Next.
  9. Set up Delivery Settings rules.
    1. Select Slack channels and members you want Flow to send messages to.
      • For Individual rules, select the member to receive data.
      • For Team rules, select the channels and DMs to receive data.
    2. Select a timezone.
      • For both types of rules, select a timezone to determine when Flow sends messages. Flow only sends messages to your Slack workspace between 9am and 5pm in the selected timezone.
      • Select the timezone to match the recipient’s predominant timezone.
  10. Click Next.
  11. Click Add message. For more information on Adding messages, see the Add messages to Slack rules section below.

back to top

Adding messages to Slack rules

Adding messages to your Slack rules determines what types of messages Flow sends for a rule and what conditions trigger a message. There are three message categories, each with a specific message type.

Some messages are interactive and first send a message with the option to receive additional information. Click the in-message link for more information.

The three message categories are:

  • Commit: Messages relating to commit activity from the selected repos
  • Pull Request: Messages relating to PR activity from the selected repos
  • Summary: Messages relating to weekly or monthly summaries of that period’s Commit and PR activity

To add a Slack message:

  1. Create a new rule, configuring Flow scope and Delivery settings. For more information on creating Slack rules, see the Create a new rule section above.
  2. Under the Add messages step, click Add message.
  3. Under Select message criteria, select a message category from the Flow message category dropdown menu.
  4. Select a message type from the Flow message type drop down menu.
    • In the screenshot below, Pull request and Decrease in PR age are selected, so Flow will send a message when PR age decreases below the threshold you choose in the next step.
  5. Select message trigger threshold and Flow metrics for the chosen message type if available. Different messages will have various selectable and modifiable options. Set the following:
    • Trailing date range: A whole number between 1 and 365 that is used to set the lookback period for that rule. Flow looks at the trailing 14 days, vs. the 14 day period prior to the Trailing date range.
    • Y%: A specific percent change threshold from 0 to 100. This change can be an increase or decrease. If this threshold is met, Flow sends a Slack message.
    • Metric filter: A choice between pre-selected metrics in a dropdown.
    • Count of item: A count of activity items such as commits, PRs, and PR comments that must be met.
  6. Customize message text. For each message, you will see a series of variable tags that can be inserted into the message text box that is pre-populated with a default message to be delivered.
    • Raw text: The text area contains a default message. Edit the message content to fit your team’s communication style.
      • This input doesn’t support emojis, but Slack parses any native or custom emoji names into images when it displays the message.
    • Variable tags: Predefined or pre-calculated values such as percent change or list of PRs.
      • Hover over a variable tag box to show example data for that tag.
      • Click the sentence where you want the tag to go, then click the tag to insert it into the textbox at the cursor’s location.
      • Click the X within a tag to remove that tag from the message.
      • Toggle between Show variable and Show data to display either variable names or example data in the message preview.
  7. Create interactive two-part messages.
    • Some messages contain two parts to provide more info about user and team activity.
    • Include the variable tag {% @msg-part2-link %} in the body of the first message to request the second part of the message. The tag follows this format:
      • [Some default text] {% @msg-part2-link %}
      • The text in the square brackets [] displays the text linking to the second message.
      • The variable tag in the curly brackets {} behaves like any other customizable variable tag. When someone clicks the link in Slack, it sends the message’s second part.
      • The link only sends the second message once.
    • Customize the second message to fit your team’s communication style.

back to top

Testing Slack rules and messages

After you add messages to a rule, test each message by sending them to a Slack channel. Test messages display text from their templates and variable tags where calculated values typically appear.

To test a specific rules message:

  1. Navigate to the Slack integration page.
  2. Click the Messages tab.
  3. Click the rule name.
  4. Click the Messages tab on the rules details page.
  5. Click Test message next to the message you want to test. A modal appears.
  6. Select the Slack channel or individual you want to receive the test message.
  7. Click Select.
  8. Click Test Message next to the rule you want to test.
  9. When sent, each message will send with the text supplied in its template as well as the variable tags where the calculated values would be displayed. Flow displays a Success or Error badge next to each tested message.

back to top

Summary of selectable and customizable items

 Individual ruleTeam rule
Flow Scope: User(s) / Team(s)Analyzes a single user from Flow only. Cannot analyze multiple users at once or a User and a Team.Analyzes one or multiple Flow teams with or without nested teams.
Flow Scope: Repo(s)Analyzes one or more imported repos.Analyzes one or more repos that have been imported into Flow.
Delivery Settings: Slack channelSends message to a single DM within the connected workspace. Cannot be sent to multiple DMs, public group channels, or private group channels.Sends message to one or more public slack channels or individual DMs. Can't be sent to private group channels.
Delivery Settings: TimezoneSets message timezone to any available timezone. Matches the timezone in the selected recipient’s primary location.Sets message timezone to any available timezone available. Only delivers messages between 9am and 5pm in that timezone.
MessagesAdds a message to the rule. When generating a message, Flow only analyzes the user selected from the Scope section.Adds a message to the rule. When generating a message, Flow analyzes all contributors on the selected teams. Select All teams to analyze all users in your organization.

back to top

Summary of message types

This table displays message types by category. Find descriptions of each message type as well as whether it's interactive.

Message categoryMessage typeDescriptionInteractive
CommitCoding StreakA specified percent of the team committed code for a specified number of days in a row. If team members are on coding streaks of different lengths, the highest common value will be shown.Yes
 Committed code every day this weekEvery contributor on the team committed code every day that week.No
 % Gain in Fundamentals MetricA Coding value increases by a specified percent.No
 % Gain in Fundamentals Metric w/ statsA Coding value increases by a specified percent compared against a previous period over a trailing period.Yes
PRIncrease in PRs createdPRs created increases by a specified percent over a trailing period.No
 Most active PRs this weekA specified number of merged PRs have a threshold number of approvals or comments over a trailing period.No
 No open PRs older thanNo open PRs are older than a specified number of days.Yes
 Decrease in old PRsCount of PRs older than a number of days has decreased by a specified percent over a trailing period. The change is calculated as the first day of the trailing period versus now.No
 Increase in PRs merged with reviewThe percent of PRs merged over a trailing period with review increases by a specified percent versus the previous period.No
 Decrease in PR Resolution metricA PR Resolution metric decreases by a specified percent over a trailing period versus the previous period.No
SummaryWeekly SummaryWeekly summary of raw commit and PR activity.No
 Monthly SummaryMonthly summary of raw commit and PR activity.No

back to top

If you need help, please contact Pluralsight Support.