chore: active issue total count (#3936)

This commit is contained in:
Bavisetti Narayan 2024-03-12 12:24:58 +05:30 committed by GitHub
parent 2e5e14556d
commit 578bd29f6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,7 +192,15 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
)
def list(self, request, slug, project_id):
queryset = self.get_queryset()
queryset = self.get_queryset().annotate(
total_issues=Count(
"issue_cycle",
filter=Q(
issue_cycle__issue__archived_at__isnull=True,
issue_cycle__issue__is_draft=False,
),
)
)
cycle_view = request.GET.get("cycle_view", "all")
# Update the order by
@ -223,6 +231,7 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
"progress_snapshot",
# meta fields
"is_favorite",
"total_issues",
"cancelled_issues",
"completed_issues",
"started_issues",