Repository navigation
Assign Requirements Spec Editor TcView
Path: ASIDE → Test Specification → Test Specification + Test Case Viewer
URLs: gui/templates/testcases/testSpec.html?tproject_id=<id>[&tcase_id=<id>] and gui/templates/testcases/tcView.html?tcase_id=<id>
BFF API: api/requirements/index.php (share of the requirements router):
GET /assign-reqspecs?tproject_id=N, GET /assign-reqs?req_spec_id=N&tcase_id=X,
POST /assign-reqs {tcase_id, req_ids[]} (→ requirement_mgr::assign_to_tcase()),
POST /unassign-reqs {link_ids[]} (→ delReqVersionTCVersionLinkByID()).
Session auth, JSON I/O.
Replaces: the legacy per-test-case "Assign Requirements" workflow
(reqTcAssign.php?edit=testcase) for the modernized Test Specification editor
and the TC Viewer (the Requirements-section bulk assignReqs.html screen is
unchanged). Refs: #912.
Re-adds per-test-case requirement assignment to the modern screens.
-
Test Specification (
testSpec.html) — an Assign Requirements button sits in the test-case action bar. It opens a modal:-
Requirement Specification combo (
GET /assign-reqspecs, dotted[RS-912] - namenaming). -
Free Requirements and Assigned Requirements two-list (the same
data contract as legacy
processTestCase()), with live counts and empty-state notices. -
>> Assignlinks each selected free requirement's latest version to the test case's latest version;<< Unassignremoves coverage links by link id. - Toast feedback on success/failure (
assignDone,unassignDone,assignFailed,unassignFailed,selectOneReq,selectOneLink, ...).
-
Requirement Specification combo (
-
Test Case Viewer (
tcView.html) — a toolbar Assign Requirements button (visible only on the latest version) opens the same modal. After each live assign/unassign the main Requirements section of the page refetchesaction=viewand re-renders without a page reload. -
Restore an assignment → count pills and lists update live; the
standalone
assignReqs.htmlscreen keeps working.
| Condition | Behaviour |
|---|---|
project option requirementsEnabled disabled |
button hidden (both screens) |
missing grant req_tcase_link_management
|
button hidden (both screens) |
| tcView on a non-latest version | button hidden (links are version-agnostic latest→latest) |
The option flags are served by api/testcases/index.php via tprojectOpt(),
which tolerates both object and array shapes of the stored options
blob (array blobs previously made requirementsEnabled silently false).


New keys in all 10 locale bundles (en/ro/de/es/fr/it/ja/pt/ru/zh):
tspec.assignRequirements, tcview.assignRequirements. The modal reuses the
reqAssign.* family. Footer buttons: tspec.cancel + rpt.close.
Suite #912 in tmp/TLU_Test_Cases.md — 10/10 PASS (assign/unassign
round-trip, empty states, tcView live refresh, gating, Event Viewer hygiene).