Is there an existing issue for this?
Current behavior
When I view analytics charts filtered by a cycle or module, the daily stats chart shows incorrect data. The queryset is reassigned from Issue objects to a flat .values_list("issue_id", flat=True) queryset anchored to CycleIssue/ModuleIssue. Subsequent .values("created_at__date") calls then use the join table's created_at instead of Issue.created_at, producing wrong date groupings in the chart.
Code pattern:
cycle_issues = CycleIssue.objects.filter(...).values_list("issue_id", flat=True)
queryset = cycle_issues # queryset is now CycleIssue IDs, not Issue objects
queryset.values("created_at__date") # uses CycleIssue.created_at, not Issue.created_at
What I expect is that analytics charts for cycles and modules correctly reflect issue creation dates.
File: apps/api/plane/app/views/analytic/project_analytics.py, lines 202 and 214
Steps to reproduce
- Open Analytics for a project
-
- Filter the chart by a specific cycle or module
-
- Observe the daily chart data doesn't match the actual issue creation dates
Environment
Production
Browser
Google Chrome
Variant
Cloud
Version
v0.17.0-dev
Is there an existing issue for this?
Current behavior
When I view analytics charts filtered by a cycle or module, the daily stats chart shows incorrect data. The queryset is reassigned from Issue objects to a flat .values_list("issue_id", flat=True) queryset anchored to CycleIssue/ModuleIssue. Subsequent .values("created_at__date") calls then use the join table's created_at instead of Issue.created_at, producing wrong date groupings in the chart.
Code pattern:
cycle_issues = CycleIssue.objects.filter(...).values_list("issue_id", flat=True)
queryset = cycle_issues # queryset is now CycleIssue IDs, not Issue objects
queryset.values("created_at__date") # uses CycleIssue.created_at, not Issue.created_at
What I expect is that analytics charts for cycles and modules correctly reflect issue creation dates.
File: apps/api/plane/app/views/analytic/project_analytics.py, lines 202 and 214
Steps to reproduce
Environment
Production
Browser
Google Chrome
Variant
Cloud
Version
v0.17.0-dev