labels.md 11,7 КБ
Newer Older
GitLab Bot's avatar
GitLab Bot включено в состав коммита
1
2
3
4
5
6
---
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---

Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
7
8
# Labels

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
9
## Overview
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
10

GitLab Bot's avatar
GitLab Bot включено в состав коммита
11
12
13
14
15
16
17
18
19
20
21
22
As your count of issues, merge requests, and epics grows in GitLab, it's more and more challenging
to keep track of those items. Especially as your organization grows from just a few people to
hundreds or thousands. This is where labels come in. They help you organize and tag your work
so you can track and find the work items you're interested in.

Labels are a key part of [issue boards](issue_board.md). With labels you can:

- Categorize epics, issues, and merge requests using colors and descriptive titles like
`bug`, `feature request`, or `docs`.
- Dynamically filter and manage epics, issues, and merge requests.
- [Search lists of issues, merge requests, and epics](../search/index.md#issues-and-merge-requests),
  as well as [issue boards](../search/index.md#issue-boards).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
23

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
24
25
## Project labels and group labels

GitLab Bot's avatar
GitLab Bot включено в состав коммита
26
There are two types of labels in GitLab:
Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
27

GitLab Bot's avatar
GitLab Bot включено в состав коммита
28
- **Project labels** can be assigned to issues and merge requests in that project only.
GitLab Bot's avatar
GitLab Bot включено в состав коммита
29
30
31
- **Group labels** can be assigned to issues and merge requests in any project in
  the selected group or its subgroups.
  - They can also be assigned to epics in the selected group or its subgroups.**(ULTIMATE)**
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
32

GitLab Bot's avatar
GitLab Bot включено в состав коммита
33
## Assign and unassign labels
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
34

GitLab Bot's avatar
GitLab Bot включено в состав коммита
35
36
Every issue, merge request and epic can be assigned any number of labels. The labels are
managed in the right sidebar, where you can assign or unassign labels as needed.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
37

GitLab Bot's avatar
GitLab Bot включено в состав коммита
38
To assign a label to an issue, merge request or epic:
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
39

GitLab Bot's avatar
GitLab Bot включено в состав коммита
40
41
42
43
44
1. In the label section of the sidebar, click **Edit**, then:
   - In the list, click the labels you want. Each label is flagged with a checkmark.
   - Find labels by entering a search query and clicking search (**{search}**), then
     click on them. You can search repeatedly and add more labels.
1. Click **X** or anywhere outside the label section and the labels are applied.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
45

GitLab Bot's avatar
GitLab Bot включено в состав коммита
46
You can also assign a label with the [`/label ~label1 ~label2` quick action](quick_actions.md).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
47

GitLab Bot's avatar
GitLab Bot включено в состав коммита
48
## Label management
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
49

GitLab Bot's avatar
GitLab Bot включено в состав коммита
50
51
Users with a [permission level](../permissions.md) of Reporter or higher are able to create
and edit labels.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
52

GitLab Bot's avatar
GitLab Bot включено в состав коммита
53
### Project labels
Mark Fletcher's avatar
Mark Fletcher включено в состав коммита
54

GitLab Bot's avatar
GitLab Bot включено в состав коммита
55
56
View the project labels list by going to the project and clicking **Issues > Labels**.
The list includes all labels that are defined at the project level, as well as all
GitLab Bot's avatar
GitLab Bot включено в состав коммита
57
labels inherited from the immediate parent group. You can filter the list by entering a search
GitLab Bot's avatar
GitLab Bot включено в состав коммита
58
query at the top and clicking search (**{search}**).
Mark Fletcher's avatar
Mark Fletcher включено в состав коммита
59

GitLab Bot's avatar
GitLab Bot включено в состав коммита
60
To create a new project label:
Mark Fletcher's avatar
Mark Fletcher включено в состав коммита
61

GitLab Bot's avatar
GitLab Bot включено в состав коммита
62
63
64
65
66
67
68
1. Navigate to **Issues > Labels** in the project.
1. Click the **New label** button.
   - Enter the title.
   - (Optional) Enter a description.
   - (Optional) Select a background color by clicking on the available colors, or input
     a hex color value for a specific color.
1. Click **Create label** to create the label.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
69

GitLab Bot's avatar
GitLab Bot включено в состав коммита
70
71
You can also create a new project label from within an issue or merge request. In the
label section of the right sidebar of an issue or a merge request:
Mark Fletcher's avatar
Mark Fletcher включено в состав коммита
72

GitLab Bot's avatar
GitLab Bot включено в состав коммита
73
74
75
76
77
78
79
1. Click **Edit**.
1. Click **Create project label**.
   - Fill in the name field. Note that you can't specify a description if creating a label
     this way. You can add a description later by editing the label (see below).
   - (Optional) Select a color by clicking on the available colors, or input a hex
     color value for a specific color.
1. Click **Create**.
Mark Fletcher's avatar
Mark Fletcher включено в состав коммита
80

GitLab Bot's avatar
GitLab Bot включено в состав коммита
81
82
83
Once created, you can edit a label by clicking the pencil (**{pencil}**), or delete
a label by clicking the three dots (**{ellipsis_v}**) next to the **Subscribe** button
and selecting **Delete**.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
84

GitLab Bot's avatar
GitLab Bot включено в состав коммита
85
86
87
CAUTION: **Caution:**
If you delete a label, it is permanently deleted. You will not be able to undo the deletion, and all references to the label will be removed from the system.

GitLab Bot's avatar
GitLab Bot включено в состав коммита
88
#### Promote a project label to a group label
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
89

GitLab Bot's avatar
GitLab Bot включено в состав коммита
90
If you previously created a project label and now want to make it available for other
GitLab Bot's avatar
GitLab Bot включено в состав коммита
91
92
93
94
95
96
97
98
projects within the same group, you can promote it to a group label.

If other projects in the same group have a label with the same title, they will all be
merged with the new group label. If a group label with the same title exists, it will
also be merged.

All issues, merge requests, issue board lists, issue board filters, and label subscriptions
with the old labels will be assigned to the new group label.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
99

GitLab Bot's avatar
GitLab Bot включено в состав коммита
100
CAUTION: **Caution:**
GitLab Bot's avatar
GitLab Bot включено в состав коммита
101
Promoting a label is a permanent action, and cannot be reversed.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
102

GitLab Bot's avatar
GitLab Bot включено в состав коммита
103
To promote a project label to a group label:
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
104

GitLab Bot's avatar
GitLab Bot включено в состав коммита
105
106
107
1. Navigate to **Issues > Labels** in the project.
1. Click on the three dots (**{ellipsis_v}**) next to the **Subscribe** button and
   select **Promote to group label**.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
108

GitLab Bot's avatar
GitLab Bot включено в состав коммита
109
### Group labels
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
110

GitLab Bot's avatar
GitLab Bot включено в состав коммита
111
112
113
114
View the group labels list by going to the group and clicking **Issues > Labels**.
The list includes all labels that are defined at the group level only. It does not
list any labels that are defined in projects. You can filter the list by entering
a search query at the top and clicking search (**{search}**).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
115

GitLab Bot's avatar
GitLab Bot включено в состав коммита
116
117
To create a **group label**, navigate to **Issues > Labels** in the group and
follow the same process as [creating a project label](#project-labels).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
118

GitLab Bot's avatar
GitLab Bot включено в состав коммита
119
#### Create group labels from epics **(ULTIMATE)**
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
120

GitLab Bot's avatar
GitLab Bot включено в состав коммита
121
122
123
You can create group labels from the Epic sidebar. The labels you create will
belong to the immediate group to which the epic belongs. The process is the same as
creating a [project label from an issue or merge request](#project-labels).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
124

GitLab Bot's avatar
GitLab Bot включено в состав коммита
125
### Generate default labels
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
126

GitLab Bot's avatar
GitLab Bot включено в состав коммита
127
128
129
130
If a project or group has no labels, you can generate a default set of project or group
labels from the label list page. The page will show a **Generate a default set of labels**
button if the list is empty, and clicking it will add the following default labels
to the project:
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
131

GitLab Bot's avatar
GitLab Bot включено в состав коммита
132
133
134
135
136
137
138
139
- `bug`
- `confirmed`
- `critical`
- `discussion`
- `documentation`
- `enhancement`
- `suggestion`
- `support`
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
140

GitLab Bot's avatar
GitLab Bot включено в состав коммита
141
## Scoped labels **(PREMIUM)**
Victor Wu's avatar
Victor Wu включено в состав коммита
142

GitLab Bot's avatar
GitLab Bot включено в состав коммита
143
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9175) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.10.
Victor Wu's avatar
Victor Wu включено в состав коммита
144

GitLab Bot's avatar
GitLab Bot включено в состав коммита
145
146
147
Scoped labels allow teams to use the label feature to annotate issues, merge requests
and epics with mutually exclusive labels. This can enable more complicated workflows
by preventing certain labels from being used together.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
148

GitLab Bot's avatar
GitLab Bot включено в состав коммита
149
150
A label is scoped when it uses a special double-colon (`::`) syntax in the label’s
title, for example:
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
151

GitLab Bot's avatar
GitLab Bot включено в состав коммита
152
![Sample scoped labels](img/labels_key_value_v12_1.png)
Victor Wu's avatar
Victor Wu включено в состав коммита
153

GitLab Bot's avatar
GitLab Bot включено в состав коммита
154
155
156
An issue, merge request or epic cannot have two scoped labels, of the form `key::value`,
with the same `key`. Adding a new label with the same `key`, but a different `value` will
cause the previous `key` label to be replaced with the new label.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
157

GitLab Bot's avatar
GitLab Bot включено в состав коммита
158
Example use case:
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
159

GitLab Bot's avatar
GitLab Bot включено в состав коммита
160
161
162
163
164
165
1. An issue is identified as being low priority, and a `priority::low` project
   label is added to it.
1. After more review the issue priority is increased, and a `priority::high` label is
   added.
1. GitLab automatically removes the `priority::low` label, as an issue should not
   have two priority labels at the same time.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
166

GitLab Bot's avatar
GitLab Bot включено в состав коммита
167
### Workflows with scoped labels
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
168

GitLab Bot's avatar
GitLab Bot включено в состав коммита
169
170
171
172
173
Suppose you wanted a custom field in issues to track the operating system platform
that your features target, where each issue should only target one platform. You
would then create three labels `platform::iOS`, `platform::Android`, `platform::Linux`.
Applying any one of these labels on a given issue would automatically remove any other
existing label that starts with `platform::`.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
174

GitLab Bot's avatar
GitLab Bot включено в состав коммита
175
176
177
178
179
180
The same pattern could be applied to represent the workflow states of your teams.
Suppose you have the labels `workflow::development`, `workflow::review`, and
`workflow::deployed`. If an issue already has the label `workflow::development`
applied, and a developer wanted to advance the issue to `workflow::review`, they
would simply apply that label, and the `workflow::development` label would
automatically be removed. This behavior already exists when you move issues
GitLab Bot's avatar
GitLab Bot включено в состав коммита
181
across label lists in an [issue board](issue_board.md#create-workflows), but
GitLab Bot's avatar
GitLab Bot включено в состав коммита
182
183
now, team members who may not be working in an issue board directly would still
be able to advance workflow states consistently in issues themselves.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
184

GitLab Bot's avatar
GitLab Bot включено в состав коммита
185
186
This functionality is demonstrated in a video regarding
[using scoped labels for custom fields and workflows](https://www.youtube.com/watch?v=4BCBby6du3c).
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
187

GitLab Bot's avatar
GitLab Bot включено в состав коммита
188
### Scoped labels with nested scopes
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
189

GitLab Bot's avatar
GitLab Bot включено в состав коммита
190
191
You can create a label with a nested scope by using multiple double colons `::` when creating
it. In this case, everything before the last `::` will be the scope.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
192

GitLab Bot's avatar
GitLab Bot включено в состав коммита
193
194
195
For example, `workflow::backend::review` and `workflow::backend::development` are valid
scoped labels, but they **can't** exist on the same issue at the same time, as they
both share the same scope, `workflow::backend`.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
196

GitLab Bot's avatar
GitLab Bot включено в состав коммита
197
Additionally, `workflow::backend::review` and `workflow::frontend::review` are valid
GitLab Bot's avatar
GitLab Bot включено в состав коммита
198
199
scoped labels, and they **can** exist on the same issue at the same time, as they
both have different scopes, `workflow::frontend` and `workflow::backend`.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
200

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
201
## Subscribing to labels
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
202

GitLab Bot's avatar
GitLab Bot включено в состав коммита
203
204
205
206
207
208
209
From the project label list page and the group label list page, you can click **Subscribe**
to the right of any label to enable [notifications](../profile/notifications.md) for that
label. You will be notified whenever the label is assigned to an epic,
issue, or merge request.

If you are subscribing to a group label from within a project, you can select to subscribe
to label notifications for the project only, or the whole group.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
210

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
211
![Labels subscriptions](img/labels_subscriptions_v12_1.png)
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
212

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
213
## Label priority
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
214

GitLab Bot's avatar
GitLab Bot включено в состав коммита
215
216
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/14189) in GitLab 8.9.
> - Priority sorting is based on the highest priority label only. [This discussion](https://gitlab.com/gitlab-org/gitlab/-/issues/14523) considers changing this.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
217

GitLab Bot's avatar
GitLab Bot включено в состав коммита
218
219
220
221
Labels can have relative priorities, which are used in the **Label priority** and
**Priority** sort orders of the epic, issue, and merge request list pages. Prioritization
for both group and project labels happens at the project level, and cannot be done
from the group label list.
Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
222
223
224
225
226

From the project label list page, star a label to indicate that it has a priority.

![Labels prioritized](img/labels_prioritized_v12_1.png)

GitLab Bot's avatar
GitLab Bot включено в состав коммита
227
228
Drag starred labels up and down the list to change their priority, where higher in the list
means higher priority.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
229

Marcel Amirault's avatar
Marcel Amirault включено в состав коммита
230
![Drag to change label priority](img/labels_drag_priority_v12_1.gif)
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
231

GitLab Bot's avatar
GitLab Bot включено в состав коммита
232
On the epic, merge request, and issue list pages (for both groups and projects) you
GitLab Bot's avatar
GitLab Bot включено в состав коммита
233
can sort by `Label priority` or `Priority`.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
234

GitLab Bot's avatar
GitLab Bot включено в состав коммита
235
If you sort by `Label priority`, GitLab uses this sort comparison order:
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
236

GitLab Bot's avatar
GitLab Bot включено в состав коммита
237
238
1. Items with a higher priority label.
1. Items without a prioritized label.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
239

GitLab Bot's avatar
GitLab Bot включено в состав коммита
240
Ties are broken arbitrarily. Note that only the highest prioritized label is checked,
GitLab Bot's avatar
GitLab Bot включено в состав коммита
241
and labels with a lower priority are ignored. See this [related issue](https://gitlab.com/gitlab-org/gitlab/-/issues/14523)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
242
for more information.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
243

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
244
![Labels sort label priority](img/labels_sort_label_priority.png)
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
245

GitLab Bot's avatar
GitLab Bot включено в состав коммита
246
If you sort by `Priority`, GitLab uses this sort comparison order:
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
247

GitLab Bot's avatar
GitLab Bot включено в состав коммита
248
249
250
251
252
1. Items with milestones that have due dates, where the soonest assigned [milestone](milestones/index.md)
   is listed first.
1. Items with milestones with no due dates.
1. Items with a higher priority label.
1. Items without a prioritized label.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
253

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
254
Ties are broken arbitrarily.
Achilleas Pipinellis's avatar
Achilleas Pipinellis включено в состав коммита
255

Victor Wu 🌴Vacation Feb 10-18🌴's avatar
Victor Wu 🌴Vacation Feb 10-18🌴 включено в состав коммита
256
![Labels sort priority](img/labels_sort_priority.png)
GitLab Bot's avatar
GitLab Bot включено в состав коммита
257
258
259
260
261
262
263
264
265
266
267
268
269

## Troubleshooting

### Some label titles end with `_duplicate<number>`

In specific circumstances it was possible to create labels with duplicate titles in the same
namespace.

To resolve the duplication, [in GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21384)
and later, some duplicate labels have `_duplicate<number>` appended to their titles.

You can safely change these labels' titles if you prefer.
For details of the original problem, see [issue 30390](https://gitlab.com/gitlab-org/gitlab/issues/30390).