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.
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.
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:
- In Flow's top navigation, click Settings.
- In the left navigation under Report Settings, click Messages.
- 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.
Creating a new rule
Create rules so Flow sends Slack messages when metrics or work patterns change in Flow.
To create a new rule:
- In Flow's top navigation, click Settings.
- In the left navigation under Report settings, click Messages.
- Under the Slack integration tab, click Create rule.
- Name a rule.
- 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.
- Click Next.
- 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.
- Click Next.
- Set up Delivery Settings rules.
- 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.
- 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.
- Select Slack channels and members you want Flow to send messages to.
- Click Next.
- Click Add message. For more information on Adding messages, see the Add messages to Slack rules section below.
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:
- 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.
- Under the Add messages step, click Add message.
- Under Select message criteria, select a message category from the Flow message category dropdown menu.
- 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.
- 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.
- 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.
-
Raw text: The text area contains a default message. Edit the message content to fit your team’s communication style.
- 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.
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:
- Navigate to the Slack integration page.
- Click the Messages tab.
- Click the rule name.
- Click the Messages tab on the rules details page.
- Click Test message next to the message you want to test. A modal appears.
- Select the Slack channel or individual you want to receive the test message.
- Click Select.
- Click Test Message next to the rule you want to test.
- 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.
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. |
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 |