Allow to reference work items (of requirements type) from test reports
Currently users can reference individual requirements from test reports by their iid
.
Before we can deprecate and remove Requirements legacy object IID, users should be able to reference individual requirements independently on the requirement's iid
(e.g. by work item's iid
or something else).
We'll need to handle if the work item being referenced isn't a requirement (e.g. an epic or issue) similarly to how we handle if the work item's iid
doesn't exist in that project.
From @jprovaznik's comment in &9203 (comment 1168819147):
update TestReport to accept new references - extend https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/models/requirements_management/test_report.rb#L60 to check format of the reference provided from the CI job. Currently keys are djust IID integers - https://docs.gitlab.com/ee/user/project/requirements/#specifying-individual-requirements (or
*
), so we could check here if the keys is an integer, treat it as old requirement IID. If it's the new format (either issue reference prefixed with#
or whatver else is used), then find the work item by this reference.