Assign Requirements Spec Editor TcView - sebiboga/testlink-upgraded GitHub Wiki
Assign Requirements β Test Specification Editor + TC Viewer (Modernized)
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.
What it does
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.
Visibility gating
| 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).
Screenshots


i18n
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.
Test cases
Suite #912 in tmp/TLU_Test_Cases.md β 10/10 PASS (assign/unassign
round-trip, empty states, tcView live refresh, gating, Event Viewer hygiene).