2019-07-15 10:11:49 -04:00
|
|
|
# GitLab Slack application **(FREE ONLY)**
|
2019-04-23 23:16:53 -04:00
|
|
|
|
2020-05-10 20:09:29 -04:00
|
|
|
> - Introduced in GitLab 9.4.
|
|
|
|
> - Distributed to Slack App Directory in GitLab 10.2.
|
|
|
|
|
2019-04-23 23:16:53 -04:00
|
|
|
NOTE: **Note:**
|
|
|
|
The GitLab Slack application is only configurable for GitLab.com. It will **not**
|
|
|
|
work for on-premises installations where you can configure the
|
2020-02-24 07:09:00 -05:00
|
|
|
[Slack slash commands](slack_slash_commands.md) service instead. We're planning
|
|
|
|
to make this configurable for all GitLab installations, but there's
|
2020-05-21 23:08:28 -04:00
|
|
|
no ETA - see [#28164](https://gitlab.com/gitlab-org/gitlab/-/issues/28164).
|
2019-04-23 23:16:53 -04:00
|
|
|
|
|
|
|
Slack provides a native application which you can enable via your project's
|
|
|
|
integrations on GitLab.com.
|
|
|
|
|
|
|
|
## Slack App Directory
|
|
|
|
|
|
|
|
The simplest way to enable the GitLab Slack application for your workspace is to
|
|
|
|
install the [GitLab application](https://slack-platform.slack.com/apps/A676ADMV5-gitlab) from
|
|
|
|
the [Slack App Directory](https://slack.com/apps).
|
|
|
|
|
|
|
|
Clicking install will take you to the
|
|
|
|
[GitLab Slack application landing page](https://gitlab.com/profile/slack/edit)
|
|
|
|
where you can select a project to enable the GitLab Slack application for.
|
|
|
|
|
|
|
|
![GitLab Slack application landing page](img/gitlab_slack_app_landing_page.png)
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
Alternatively, you can configure the Slack application with a project's
|
|
|
|
integration settings.
|
|
|
|
|
|
|
|
Keep in mind that you need to have the appropriate permissions for your Slack
|
|
|
|
team in order to be able to install a new application, read more in Slack's
|
2020-06-04 17:08:11 -04:00
|
|
|
docs on [Adding an app to your workspace](https://slack.com/help/articles/202035138-Add-an-app-to-your-workspace).
|
2019-04-23 23:16:53 -04:00
|
|
|
|
|
|
|
To enable GitLab's service for your Slack team:
|
|
|
|
|
2020-05-10 20:09:29 -04:00
|
|
|
1. Go to your project's **{settings}** **Settings > Integration > Slack application** (only
|
|
|
|
visible on GitLab.com).
|
|
|
|
1. Click **Add to Slack**.
|
2019-04-23 23:16:53 -04:00
|
|
|
|
|
|
|
That's all! You can now start using the Slack slash commands.
|
|
|
|
|
2020-05-10 20:09:29 -04:00
|
|
|
## Create a project alias for Slack
|
|
|
|
|
|
|
|
To create a project alias on GitLab.com for Slack integration:
|
|
|
|
|
|
|
|
1. Go to your project's home page.
|
|
|
|
1. Navigate to **{settings}** **Settings > Integrations** (only visible on GitLab.com)
|
|
|
|
1. On the **Integrations** page, click **Slack application**.
|
|
|
|
1. The current **Project Alias**, if any, is displayed. To edit this value,
|
|
|
|
click **Edit**.
|
|
|
|
1. Enter your desired alias, and click **Save changes**.
|
|
|
|
|
|
|
|
Some Slack commands require a project alias, and fail with the following error
|
|
|
|
if the project alias is incorrect or missing from the command:
|
|
|
|
|
|
|
|
```plaintext
|
|
|
|
GitLab error: project or alias not found
|
|
|
|
```
|
|
|
|
|
2019-04-23 23:16:53 -04:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
After confirming the installation, you, and everyone else in your Slack team,
|
2020-04-06 08:10:44 -04:00
|
|
|
can use all the [slash commands](../../../integration/slash_commands.md).
|
2019-04-23 23:16:53 -04:00
|
|
|
|
|
|
|
When you perform your first slash command you will be asked to authorize your
|
|
|
|
Slack user on GitLab.com.
|
|
|
|
|
2020-04-06 08:10:44 -04:00
|
|
|
The only difference with the [manually configurable Slack slash commands](slack_slash_commands.md)
|
2019-04-23 23:16:53 -04:00
|
|
|
is that all the commands should be prefixed with the `/gitlab` keyword.
|
|
|
|
We are working on making this configurable in the future.
|
|
|
|
|
2019-09-18 14:06:14 -04:00
|
|
|
For example, to show the issue number `1001` under the `gitlab-org/gitlab`
|
2019-04-23 23:16:53 -04:00
|
|
|
project, you would do:
|
|
|
|
|
2020-02-28 22:07:51 -05:00
|
|
|
```plaintext
|
2019-09-18 14:06:14 -04:00
|
|
|
/gitlab gitlab-org/gitlab issue show 1001
|
2019-04-23 23:16:53 -04:00
|
|
|
```
|