project_requirements
Gets or lists a project_requirements resource.
Overview​
| Name | project_requirements |
| Type | Resource |
| Id | gitlab.projects.project_requirements |
Fields​
The following fields are returned by SELECT queries:
- list
GraphQL response envelope
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the requirement. |
author | object | UserCore identity (id, username, name) |
created_at | string | Timestamp of when the requirement was created. |
description | string | Description of the requirement. |
last_test_report_manually_created | boolean | Indicates if latest test report was created by user. |
last_test_report_state | string | Latest requirement test report state. (PASSED, FAILED) |
project | object | Project identity (id, full_path, name) |
state | string | State of the requirement. (OPENED, ARCHIVED) |
title | string | Title of the requirement. |
updated_at | string | Timestamp of when the requirement was last updated. |
work_item_iid | string | Work item IID of the requirement, will replace current IID as identifier soon. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | full_path, host | last_test_report_state, search, sort, state, work_item_iid | Find requirements. Generated from the GitLab GraphQL schema field Project.requirements (connection of Requirement nodes). |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
full_path | string | Full path of the project, for example gitlab-org/gitlab |
host | string | GitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST) |
last_test_report_state | string | State of latest requirement test report. |
search | string | Search query for requirement title. |
sort | string | List requirements by sort order. |
state | string | Filter requirements by state. |
work_item_iid | string | IID of the requirement work item, for example, "1". |
SELECT examples​
- list
Find requirements. Generated from the GitLab GraphQL schema field Project.requirements (connection of Requirement nodes).
SELECT
id,
author,
created_at,
description,
last_test_report_manually_created,
last_test_report_state,
project,
state,
title,
updated_at,
work_item_iid
FROM gitlab.projects.project_requirements
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND last_test_report_state = '{{ last_test_report_state }}'
AND search = '{{ search }}'
AND sort = '{{ sort }}'
AND state = '{{ state }}'
AND work_item_iid = '{{ work_item_iid }}'
;