Skip to main content

project_requirements

Gets or lists a project_requirements resource.

Overview​

Nameproject_requirements
TypeResource
Idgitlab.projects.project_requirements

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringID of the requirement.
authorobjectUserCore identity (id, username, name)
created_atstringTimestamp of when the requirement was created.
descriptionstringDescription of the requirement.
last_test_report_manually_createdbooleanIndicates if latest test report was created by user.
last_test_report_statestringLatest requirement test report state. (PASSED, FAILED)
projectobjectProject identity (id, full_path, name)
statestringState of the requirement. (OPENED, ARCHIVED)
titlestringTitle of the requirement.
updated_atstringTimestamp of when the requirement was last updated.
work_item_iidstringWork item IID of the requirement, will replace current IID as identifier soon.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfull_path, hostlast_test_report_state, search, sort, state, work_item_iidFind 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.

NameDatatypeDescription
full_pathstringFull path of the project, for example gitlab-org/gitlab
hoststringGitLab 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_statestringState of latest requirement test report.
sortstringList requirements by sort order.
statestringFilter requirements by state.
work_item_iidstringIID of the requirement work item, for example, "1".

SELECT examples​

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 }}'
;