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 DM or work channel.

Who can use this?

 Core
Plus
 
  


Permissions

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 Rule
Team 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 channel
Sends 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: Timezone
Sets 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.
Messages
Adds 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 Category
Message Type
Description
Interactive
Commit
Coding Streak
A 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 week
Every contributor on the team committed code every day that week.
No

% Gain in Fundamentals Metric
A Coding value increases by a specified percent.
No

% Gain in Fundamentals Metric w/ stats
A Coding value increases by a specified percent compared against a previous period over a trailing period.
Yes
PR
Increase in PRs created
PRs created increases by a specified percent over a trailing period.
No

Most active PRs this week
A specified number of merged PRs have a threshold number of approvals or comments over a trailing period.
No

No open PRs older than
No open PRs are older than a specified number of days.
Yes

Decrease in old PRs
Count 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 review
The percent of PRs merged over a trailing period with review increases by a specified percent versus the previous period.
No

Decrease in PR Resolution metric
A PR Resolution metric decreases by a specified percent over a trailing period versus the previous period.
No
Summary
Weekly Summary
Weekly summary of raw commit and PR activity.
No

Monthly Summary
Monthly summary of raw commit and PR activity.
No

back to top


If you need help, please email Support (opens email form) for 24/7 assistance.