1---
2type: reference, howto
3stage: Plan
4group: Certify
5info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
6---
7
8# Requirements Management **(ULTIMATE)**
9
10NOTE:
11In 14.4, Requirements was moved under **Issues**.
12
13> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2703) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.10.
14> - The ability to add and edit a requirement's long description [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/224622) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.5.
15> - [Moved under Issues](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70748) in 14.4
16
17With requirements, you can set criteria to check your products against. They can be based on users,
18stakeholders, system, software, or anything else you find important to capture.
19
20INFO:
21Meet your compliance needs with requirements in GitLab.
22[Try Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-project-requirements-docs).
23
24A requirement is an artifact in GitLab which describes the specific behavior of your product.
25Requirements are long-lived and don't disappear unless manually cleared.
26
27If an industry standard *requires* that your application has a certain feature or behavior, you can
28[create a requirement](#create-a-requirement) to reflect this.
29When a feature is no longer necessary, you can [archive the related requirement](#archive-a-requirement).
30
31<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
32For an overview, see [GitLab 12.10 Introduces Requirements Management](https://www.youtube.com/watch?v=uSS7oUNSEoU).
33
34<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
35For a more in-depth walkthrough using a [demonstration project](https://gitlab.com/gitlab-org/requiremeents-mgmt),
36see [GitLab Requirements Traceability Walkthrough](https://youtu.be/VIiuTQYFVa0) (Feb 2021).
37
38![requirements list view](img/requirements_list_v13_5.png)
39
40## Create a requirement
41
42A paginated list of requirements is available in each project, and there you
43can create a new requirement.
44
45Prerequisite:
46
47- You must have at least the Reporter [role](../../permissions.md).
48
49To create a requirement:
50
511. In a project, go to **Issues > Requirements**.
521. Select **New requirement**.
531. Enter a title and description and select **Create requirement**.
54
55![requirement create view](img/requirement_create_v13_5.png)
56
57You can see the newly created requirement on the top of the list, with the requirements
58list being sorted by creation date, in descending order.
59
60## View a requirement
61
62You can view a requirement from the list by selecting it.
63
64![requirement view](img/requirement_view_v13_5.png)
65
66To edit a requirement while viewing it, select the **Edit** icon (**{pencil}**)
67next to the requirement title.
68
69## Edit a requirement
70
71> The ability to mark a requirement as Satisfied [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218607) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.5.
72
73You can edit a requirement from the requirements list page.
74
75Prerequisite:
76
77- You must have at least the Reporter [role](../../permissions.md).
78
79To edit a requirement:
80
811. From the requirements list, select the **Edit** icon (**{pencil}**).
821. Update the title and description in text input field. You can also mark a
83   requirement as satisfied in the edit form by using the checkbox **Satisfied**.
841. Select **Save changes**.
85
86## Archive a requirement
87
88You can archive an open requirement while
89you're in the **Open** tab.
90
91Prerequisite:
92
93- You must have at least the Reporter [role](../../permissions.md).
94
95To archive a requirement, select **Archive** (**{archive}**).
96
97As soon as a requirement is archived, it no longer appears in the **Open** tab.
98
99## Reopen a requirement
100
101You can view the list of archived requirements in the **Archived** tab.
102
103Prerequisite:
104
105- You must have at least the Reporter [role](../../permissions.md).
106
107![archived requirements list](img/requirements_archived_list_view_v13_1.png)
108
109To reopen an archived requirement, select **Reopen**.
110
111As soon as a requirement is reopened, it no longer appears in the **Archived** tab.
112
113## Search for a requirement
114
115> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/212543) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.1.
116> - Searching by status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/224614) in GitLab 13.10.
117
118You can search for a requirement from the requirements list page based on the following criteria:
119
120- Title
121- Author's username
122- Status (satisfied, failed, or missing)
123
124To search for a requirement:
125
1261. In a project, go to **Issues > Requirements > List**.
1271. Select the **Search or filter results** field. A dropdown menu appears.
1281. Select the requirement author or status from the dropdown or enter plain text to search by requirement title.
1291. Press <kbd>Enter</kbd> on your keyboard to filter the list.
130
131You can also sort the requirements list by:
132
133- Created date
134- Last updated
135
136## Allow requirements to be satisfied from a CI job
137
138> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/2859) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.1.
139> - [Added](https://gitlab.com/gitlab-org/gitlab/-/issues/215514) ability to specify individual requirements and their statuses in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.2.
140
141GitLab supports [requirements test reports](../../../ci/yaml/artifacts_reports.md#artifactsreportsrequirements) now.
142You can add a job to your CI pipeline that, when triggered, marks all existing
143requirements as Satisfied (you may manually satisfy a requirement in the edit form [edit a requirement](#edit-a-requirement)).
144
145### Add the manual job to CI
146
147To configure your CI to mark requirements as Satisfied when the manual job is
148triggered, add the code below to your `.gitlab-ci.yml` file.
149
150```yaml
151requirements_confirmation:
152  when: manual
153  allow_failure: false
154  script:
155    - mkdir tmp
156    - echo "{\"*\":\"passed\"}" > tmp/requirements.json
157  artifacts:
158    reports:
159      requirements: tmp/requirements.json
160```
161
162This definition adds a manually-triggered (`when: manual`) job to the CI
163pipeline. It's blocking (`allow_failure: false`), but it's up to you what
164conditions you use for triggering the CI job. Also, you can use any existing CI job
165to mark all requirements as satisfied, as long as the `requirements.json`
166artifact is generated and uploaded by the CI job.
167
168When you manually trigger this job, the `requirements.json` file containing
169`{"*":"passed"}` is uploaded as an artifact to the server. On the server side,
170the requirement report is checked for the "all passed" record
171(`{"*":"passed"}`), and on success, it marks all existing open requirements as
172Satisfied.
173
174#### Specifying individual requirements
175
176It is possible to specify individual requirements and their statuses.
177
178If the following requirements exist:
179
180- `REQ-1` (with IID `1`)
181- `REQ-2` (with IID `2`)
182- `REQ-3` (with IID `3`)
183
184It is possible to specify that the first requirement passed, and the second failed.
185Valid values are "passed" and "failed".
186By omitting a requirement IID (in this case `REQ-3`'s IID `3`), no result is noted.
187
188```yaml
189requirements_confirmation:
190  when: manual
191  allow_failure: false
192  script:
193    - mkdir tmp
194    - echo "{\"1\":\"passed\", \"2\":\"failed\"}" > tmp/requirements.json
195  artifacts:
196    reports:
197      requirements: tmp/requirements.json
198```
199
200### Add the manual job to CI conditionally
201
202To configure your CI to include the manual job only when there are some open
203requirements, add a rule which checks `CI_HAS_OPEN_REQUIREMENTS` CI/CD variable.
204
205```yaml
206requirements_confirmation:
207  rules:
208    - if: "$CI_HAS_OPEN_REQUIREMENTS" == "true"
209      when: manual
210    - when: never
211  allow_failure: false
212  script:
213    - mkdir tmp
214    - echo "{\"*\":\"passed\"}" > tmp/requirements.json
215  artifacts:
216    reports:
217      requirements: tmp/requirements.json
218```
219
220## Import requirements from a CSV file
221
222> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/246857) in GitLab 13.7.
223
224You must have at least the Reporter [role](../../permissions.md).
225
226You can import requirements to a project by uploading a [CSV file](https://en.wikipedia.org/wiki/Comma-separated_values)
227with the columns `title` and `description`.
228
229After the import, the user uploading the CSV file is set as the author of the imported requirements.
230
231### Import the file
232
233Before you import your file:
234
235- Consider importing a test file containing only a few requirements. There is no way to undo a large
236  import without using the GitLab API.
237- Ensure your CSV file meets the [file format](#imported-csv-file-format) requirements.
238
239To import requirements:
240
2411. In a project, go to **Issues > Requirements**.
242   - If the project already has existing requirements, select the import icon (**{import}**) in the
243     top right.
244   - For a project without any requirements, select **Import CSV** in the middle of the page.
2451. Select the file and select **Import requirements**.
246
247The file is processed in the background and a notification email is sent
248to you after the import is complete.
249
250### Imported CSV file format
251
252When importing requirements from a CSV file, it must be formatted in a certain way:
253
254- **Header row:** CSV files must include the following headers:
255  `title` and `description`. The headers are case insensitive.
256- **Columns:** data from columns other than `title` and `description` is not imported.
257- **Separators:** the column separator is automatically detected from the header row.
258  Supported separator characters are: commas (`,`), semicolons (`;`), and tabs (`\t`).
259  The row separator can be either `CRLF` or `LF`.
260- **Double-quote character:** the double-quote (`"`) character is used to quote fields,
261  enabling the use of the column separator in a field (see the third line in the
262  sample CSV data below). To insert a double-quote (`"`) in a quoted
263  field, use two double-quote characters in succession (`""`).
264- **Data rows:** below the header row, succeeding rows must follow the same column
265  order. The title text is required, while the description is optional and can be left empty.
266
267Sample CSV data:
268
269```plaintext
270title,description
271My Requirement Title,My Requirement Description
272Another Title,"A description, with a comma"
273"One More Title","One More Description"
274```
275
276### File size
277
278The limit depends on the configuration value of Max Attachment Size for the GitLab instance.
279
280For GitLab.com, it is set to 10 MB.
281
282## Export requirements to a CSV file
283
284> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/290813) in GitLab 13.8.
285> - Revised CSV column headers [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/299247) in GitLab 13.9.
286> - Ability to select which fields to export [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/290823) in GitLab 13.9.
287
288You can export GitLab requirements to a
289[CSV file](https://en.wikipedia.org/wiki/Comma-separated_values) sent to your default notification
290email as an attachment.
291
292By exporting requirements, you and your team can import them into another tool or share them with
293your customers. Exporting requirements can aid collaboration with higher-level systems, as well as
294audit and regulatory compliance tasks.
295
296Prerequisite:
297
298- You must have at least the Reporter [role](../../permissions.md).
299
300To export requirements:
301
3021. In a project, go to **Issues > Requirements**.
3031. In the top right, select the **Export as CSV** icon (**{export}**).
304
305   A confirmation modal appears.
306
3071. Under **Advanced export options**, select which fields to export.
308
309   All fields are selected by default. To exclude a field from being exported, clear the checkbox next to it.
310
3111. Select **Export requirements**. The exported CSV file is sent to the email address associated with your user.
312
313### Exported CSV file format
314
315<!-- vale gitlab.Spelling = NO -->
316
317You can preview the exported CSV file in a spreadsheet editor, such as Microsoft Excel,
318OpenOffice Calc, or Google Sheets.
319
320<!-- vale gitlab.Spelling = YES -->
321
322The exported CSV file contains the following headers:
323
324- In GitLab 13.8:
325
326  - Requirement ID
327  - Title
328  - Description
329  - Author Username
330  - Latest Test Report State
331  - Latest Test Report Created At (UTC)
332
333- In GitLab 13.9 and later:
334
335  - Requirement ID
336  - Title
337  - Description
338  - Author
339  - Author Username
340  - Created At (UTC)
341  - State
342  - State Updated At (UTC)
343