Commit ef518df2 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'improve-slack-docs' into 'master'

Improve Slack docs

See merge request !10927
parents 7c8aadf8 7dd00a98
# Chat Commands # Chat Commands
Chat commands allow user to perform common operations on GitLab right from there chat client. Chat commands in Mattermost and Slack (also called Slack slash commands) allow you to control GitLab and view GitLab content right inside your chat client, without having to leave it. For Slack, this requires a [project service configuration](../user/project/integrations/slack_slash_commands.md). Simply type the command as a message in your chat client to activate it.
Right now both Mattermost and Slack are supported.
## Available commands Commands are scoped to a project, with a trigger term that is specified during configuration. (We suggest you use the project name as the trigger term for simplicty and clarity.) Taking the trigger term as `project-name`, the commands are:
The trigger is configurable, but for the sake of this example, we'll use `/trigger`
* `/trigger help` - Displays all available commands for this user | Command | Effect |
* `/trigger issue new <title> <shift+return> <description>` - creates a new issue on the project | ------- | ------ |
* `/trigger issue show <id>` - Shows the issue with the given ID, if you've got access | `/project-name help` | Shows all available chat commands |
* `/trigger issue search <query>` - Shows a maximum of 5 items matching the query | `/project-name issue new <title> <shift+return> <description>` | Creates a new issue with title `<title>` and description `<description>` |
* `/trigger deploy <from> to <to>` - Deploy from an environment to another | `/project-name issue show <id>` | Shows the issue with id `<id>` |
| `/project-name issue search <query>` | Shows up to 5 issues matching `<query>` |
| `/project-name deploy <from> to <to>` | Deploy from the `<from>` environment to the `<to>` environment |
\ No newline at end of file
...@@ -49,8 +49,8 @@ Click on the service links to see further configuration instructions and details ...@@ -49,8 +49,8 @@ Click on the service links to see further configuration instructions and details
| [Mattermost Notifications](mattermost.md) | Receive event notifications in Mattermost | | [Mattermost Notifications](mattermost.md) | Receive event notifications in Mattermost |
| [Microsoft teams](microsoft_teams.md) | Receive notifications for actions that happen on GitLab into a room on Microsoft Teams using Office 365 Connectors | | [Microsoft teams](microsoft_teams.md) | Receive notifications for actions that happen on GitLab into a room on Microsoft Teams using Office 365 Connectors |
| Pipelines emails | Email the pipeline status to a list of recipients | | Pipelines emails | Email the pipeline status to a list of recipients |
| [Slack Notifications](slack.md) | Receive event notifications in Slack | | [Slack Notifications](slack.md) | Send GitLab events (e.g. issue created) to Slack as notifications |
| [Slack slash commands](slack_slash_commands.md) | Slack chat and ChatOps slash commands | | [Slack slash commands](slack_slash_commands.md) | Use slash commands in Slack to control GitLab |
| PivotalTracker | Project Management Software (Source Commits Endpoint) | | PivotalTracker | Project Management Software (Source Commits Endpoint) |
| [Prometheus](prometheus.md) | Monitor the performance of your deployed apps | | [Prometheus](prometheus.md) | Monitor the performance of your deployed apps |
| Pushover | Pushover makes it easy to get real-time notifications on your Android device, iPhone, iPad, and Desktop | | Pushover | Pushover makes it easy to get real-time notifications on your Android device, iPhone, iPad, and Desktop |
......
# Slack Notifications Service # Slack Notifications Service
## On Slack The Slack Notifications Service allows your GitLab project to send events (e.g. issue created) to your existing Slack team as notifications. This requires configurations in both Slack and GitLab.
To enable Slack integration you must create an incoming webhook integration on > Note: You can also use Slack slash commands to control GitLab inside Slack. This is the separately configured [Slack slash commands](slack_slash_commands.md).
Slack:
1. [Sign in to Slack](https://slack.com/signin) ## Slack Configuration
1. Visit [Incoming WebHooks](https://my.slack.com/services/new/incoming-webhook/)
1. Choose the channel name you want to send notifications to.
1. Click **Add Incoming WebHooks Integration**
1. Copy the **Webhook URL**, we'll need this later for GitLab.
## On GitLab 1. Sign in to your Slack team and [start a new Incoming WebHooks configuration](https://my.slack.com/services/new/incoming-webhook/).
1. Select the Slack channel where notifications will be sent to by default. Click the **Add Incoming WebHooks integration** button to add the configuration.
1. Copy the **Webhook URL**, which we'll use later in the GitLab configuration.
After you set up Slack, it's time to set up GitLab. ## GitLab Configuration
Navigate to the [Integrations page](project_services.md#accessing-the-project-services) 1. Navigate to the [Integrations page](project_services.md#accessing-the-project-services) in your project's settings, i.e. **Project > Settings > Integrations**.
and select the **Slack notifications** service to configure it. 1. Select the **Slack notifications** project service to configure it.
There, you will see a checkbox with the following events that can be triggered: 1. Check the **Active** checkbox to turn on the service.
1. Check the checkboxes corresponding to the GitLab events you want to send to Slack as a notification.
1. For each event, optionally enter the Slack channel where you want to send the event. (Do _not_ include the `#` symbol.) If left empty, the event will be sent to the default channel that you configured in the Slack Configuration step.
1. Paste the **Webhook URL** that you copied from the Slack Configuration step.
1. Optionally customize the Slack bot username that will be sending the notifications.
1. Configure the remaining options and click `Save changes`.
- Push Your Slack team will now start receiving GitLab event notifications as configured.
- Issue
- Confidential issue
- Merge request
- Note
- Tag push
- Pipeline
- Wiki page
Below each of these event checkboxes, you have an input field to enter ![Slack configuration](img/slack_configuration.png)
which Slack channel you want to send that event message. Enter your preferred channel name **without** the hash sign (`#`). \ No newline at end of file
At the end, fill in your Slack details:
| Field | Description |
| ----- | ----------- |
| **Webhook** | The [incoming webhook URL][slackhook] which you have to setup on Slack. |
| **Username** | Optional username which can be on messages sent to Slack. Fill this in if you want to change the username of the bot. |
| **Notify only broken pipelines** | If you choose to enable the **Pipeline** event and you want to be only notified about failed pipelines. |
After you are all done, click **Save changes** for the changes to take effect.
>**Note:**
You can set "branch,pushed,Compare changes" as highlight words on your Slack
profile settings, so that you can be aware of new commits when somebody pushes
them.
![Slack configuration](img/slack_configuration.png)
[slackhook]: https://my.slack.com/services/new/incoming-webhook
...@@ -2,23 +2,22 @@ ...@@ -2,23 +2,22 @@
> Introduced in GitLab 8.15 > Introduced in GitLab 8.15
Slack commands give users an extra interface to perform common operations Slack slash commands (also known as chat commmands) allow you to control GitLab and view content right inside Slack, without having to leave it. This requires configurations in both Slack and GitLab.
from the chat environment. This allows one to, for example, create an issue as
soon as the idea was discussed in chat.
For all available commands try the help subcommand, for example: `/gitlab help`,
all review the [full list of commands](../../../integration/chat_commands.md).
## Prerequisites > Note: GitLab can also send events (e.g. issue created) to Slack as notifications. This is the separately configured [Slack Notifications Service](slack.md).
A [team](https://get.slack.help/hc/en-us/articles/217608418-Creating-a-team) in
Slack should be created beforehand, GitLab cannot create it for you.
## Configuration ## Configuration
Go to your project's [Integrations page](project_services.md#accessing-the-project-services) 1. Slack slash commands are scoped to a project. Navigate to the [Integrations page](project_services.md#accessing-the-project-services) in your project's settings, i.e. **Project > Settings > Integrations**.
and select the **Slack slash commands** service to configure it. 1. Select the **Slack slash commands** project service to configure it. This page contains required information to complete the configuration in Slack. Leave this browser tab open.
1. Open a new browser tab and sign in to your Slack team. [Start a new Slash Commands integration](https://my.slack.com/services/new/slash-commands).
1. Enter a trigger term. We suggest you use the project name. Click **Add Slash Command Integration**.
1. Complete the rest of the fields in the Slack configuration page using information from the GitLab browser tab. In particular, the URL needs to be copied and pasted. Click **Save Integration** to complete the configuration in Slack.
1. While still on the Slack configuration page, copy the **token**. Go back to the GitLab browser tab and paste in the **token**.
1. Check the **Active** checkbox and click **Save changes** to complete the configuration in GitLab.
![Slack setup instructions](img/slack_setup.png) ![Slack setup instructions](img/slack_setup.png)
Once you've followed the instructions, mark the service as active and insert the token ## Usage
you've received from Slack. After saving the service you are good to go!
You can now use the [Slack slash commands](../../../integration/chat_commands.md).
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment