summaryrefslogtreecommitdiff
path: root/doc/user/project/integrations/gitlab_slack_application.md
blob: 50b52421a5af52047acdc08421274aadb56d5279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
stage: Manage
group: Integrations
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---

# GitLab for Slack app **(FREE SAAS)**

NOTE:
The GitLab for Slack app is only configurable for GitLab.com. It does **not**
work for on-premises installations where you can configure
[Slack slash commands](slack_slash_commands.md) instead. See
[Slack application integration for self-managed instances](https://gitlab.com/groups/gitlab-org/-/epics/1211)
for our plans to make the app configurable for all GitLab installations.

Slack provides a native application that you can enable with your project's
integrations on GitLab.com.

## Slack App Directory

To enable the GitLab for Slack app for your workspace,
install the [GitLab application](https://slack-platform.slack.com/apps/A676ADMV5-gitlab)
from the [Slack App Directory](https://slack.com/apps).

On the [GitLab for Slack app landing page](https://gitlab.com/-/profile/slack/edit),
you can select a GitLab project to link with your Slack workspace.

## Configuration

Alternatively, you can configure the GitLab for Slack app with your project's
integration settings.

You must have the appropriate permissions for your Slack
workspace to be able to install a new application. See
[Add apps to your Slack workspace](https://slack.com/help/articles/202035138-Add-apps-to-your-Slack-workspace).

To enable the GitLab integration for your Slack workspace:

1. Go to your project's **Settings > Integration > GitLab for Slack app** (only
   visible on GitLab.com).
1. Select **Install GitLab for Slack app**.
1. Select **Allow** on Slack's confirmation screen.

You can also select **Reinstall GitLab for Slack app** to update the app in your Slack workspace
to the latest version. See [Version history](#version-history) for details.

## 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. Go to **Settings > Integrations** (only visible on GitLab.com).
1. On the **Integrations** page, select **GitLab for Slack app**.
1. The current **Project Alias**, if any, is displayed. To edit this value,
   select **Edit**.
1. Enter your desired alias, and select **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
```

## Usage

After installing the app, everyone in your Slack workspace can
use the [slash commands](../../../integration/slash_commands.md).
When you perform your first slash command, you are asked to
authorize your Slack user on GitLab.com.

The only difference with the [manually configurable Slack slash commands](slack_slash_commands.md)
is that you must prefix all commands with the `/gitlab` keyword. For example,
to show the issue number `1001` under the `gitlab-org/gitlab`
project, you must run the following command:

```plaintext
/gitlab gitlab-org/gitlab issue show 1001
```

## Version history

In GitLab 15.0 and later, the GitLab for Slack app is updated to [Slack's new granular permissions model](https://medium.com/slack-developer-blog/more-precision-less-restrictions-a3550006f9c3). While there is no change in functionality, you should reinstall the app.

## Troubleshooting

When you work with the GitLab for Slack app, the
[App Home](https://api.slack.com/start/overview#app_home) might not display properly.
As a workaround, ensure your app is up to date.

To update an existing Slack integration:

1. Go to your [chat settings](https://gitlab.com/-/profile/chat_names).
1. Next to your project, select **GitLab for Slack app**.
1. Select **Reinstall GitLab for Slack app**.

Alternatively, you can [configure a new Slack integration](https://about.gitlab.com/solutions/slack/).