User Activity report: "Tickets Assigned" column filters by ticket creation date, not assignment date #49

Open
opened 2026-08-31 21:36:17 -04:00 by jared · 0 comments
Owner

Severity: Medium

index.php (~lines 385-390), the ta subquery for the User Activity report: SELECT assigned_to, COUNT(*) ... FROM tickets WHERE DATE(created_at) BETWEEN ? AND ? GROUP BY assigned_to.

Impact: A ticket created outside the selected date range but assigned to a user within it won't count toward "Tickets Assigned"; conversely a ticket created inside the range but assigned/reassigned later still counts as if the assignment happened in-range. The column is filtered by the wrong date field for what it claims to measure, producing a misleading metric on /admin/user-activity.

Fix: If assignment date isn't tracked separately, either add an assigned_at timestamp column, derive it from audit_log assignment events, or relabel the column to clarify it's actually measuring tickets created-and-assigned-to in the range.

**Severity:** Medium `index.php` (~lines 385-390), the `ta` subquery for the User Activity report: `SELECT assigned_to, COUNT(*) ... FROM tickets WHERE DATE(created_at) BETWEEN ? AND ? GROUP BY assigned_to`. **Impact:** A ticket created outside the selected date range but assigned to a user within it won't count toward "Tickets Assigned"; conversely a ticket created inside the range but assigned/reassigned later still counts as if the assignment happened in-range. The column is filtered by the wrong date field for what it claims to measure, producing a misleading metric on `/admin/user-activity`. **Fix:** If assignment date isn't tracked separately, either add an `assigned_at` timestamp column, derive it from `audit_log` assignment events, or relabel the column to clarify it's actually measuring tickets created-and-assigned-to in the range.
jared added the priority/mediumreliability labels 2026-09-08 10:15:45 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#49