fix(jira): show test Jira tickets on technique page (correct entity model)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Techniques don't have their own Jira tickets — tickets exist on tests and campaigns. The previous JiraLinkPanel entityType='technique' always returned empty. Backend: add entity_ids (list) filter to GET /jira/links so multiple test IDs can be fetched in a single request. Frontend API: listJiraLinks() accepts entity_ids[] and serialises them as repeated query params (required by FastAPI List[UUID] parsing). TechniqueDetailPage: replace JiraLinkPanel with TechniqueJiraSection — a dedicated read-only component that: - Takes technique.tests (already loaded) - Batch-fetches all test Jira links in one request - Shows test name + ticket key + status + priority + open-in-Jira link - Hides itself when no tickets exist (avoids empty panel) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,14 +72,16 @@ def create_link(
|
||||
def list_links(
|
||||
entity_type: Optional[JiraLinkEntityType] = None,
|
||||
entity_id: Optional[UUID] = None,
|
||||
entity_ids: Optional[list[UUID]] = Query(default=None, description="Filter by multiple entity IDs"),
|
||||
db: Session = Depends(get_db),
|
||||
user: User = Depends(get_current_user),
|
||||
):
|
||||
"""List Jira links, optionally filtered by entity."""
|
||||
"""List Jira links, optionally filtered by entity or a list of entity IDs."""
|
||||
return jira_service.list_links(
|
||||
db,
|
||||
entity_type=entity_type,
|
||||
entity_id=entity_id,
|
||||
entity_ids=entity_ids,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -735,12 +735,15 @@ def list_links(
|
||||
*,
|
||||
entity_type: Optional[JiraLinkEntityType] = None,
|
||||
entity_id: Optional[UUID] = None,
|
||||
entity_ids: Optional[list[UUID]] = None,
|
||||
) -> list[JiraLink]:
|
||||
query = db.query(JiraLink)
|
||||
if entity_type:
|
||||
query = query.filter(JiraLink.entity_type == entity_type)
|
||||
if entity_id:
|
||||
query = query.filter(JiraLink.entity_id == entity_id)
|
||||
elif entity_ids:
|
||||
query = query.filter(JiraLink.entity_id.in_(entity_ids))
|
||||
return query.order_by(JiraLink.created_at.desc()).all()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user