Update requirement models to use requirement issue type
Overview
This issue is a result of our Spike - Linking Requirements to Test Cases effort.
Description
When requirements are migrated to issues (#323779 (closed), during the migration phase we should make sure that requirement is synced up with its issue), we can update related models and services to use the new issue type instead only instead of Requirement model.
But for backwards compatibility we still keep the existing requirement graphql API (used also by UI), so Requirement model could remain just a "proxy" to the requirement issue type.
On Requirement model we could keep only requirement's iid and reference to issue_id (created when migrating requirements to issue type - #323779 (comment 531766143)), then model/services used by requirements graphql API would use this issue_id
to actually to find and update the referenced issue.
Proposal
- Delegate all attributes in the model
RequirementsManagement::Requirement
to the associatedrequirement_issue
. - We should be able to create new requirement records after delegation
- The
state
attribute should be mapped to match the state on the Issue model - The sync functionality when creating and updating requirements should work after delegation
- The
test_report
association will remain linked to the requirement model because they need to be migrated to work items before the relationship can be deprecated, so that part of the work will be continued in #345842 (closed).