chore: link and attachment count in sub issues (#1352)

This commit is contained in:
pablohashescobar 2023-06-22 19:47:56 +05:30 committed by GitHub
parent 352c84b026
commit 537cd2f5dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -590,6 +590,20 @@ class SubIssuesEndpoint(BaseAPIView):
.annotate(count=Func(F("id"), function="Count")) .annotate(count=Func(F("id"), function="Count"))
.values("count") .values("count")
) )
.annotate(
link_count=IssueLink.objects.filter(issue=OuterRef("id"))
.order_by()
.annotate(count=Func(F("id"), function="Count"))
.values("count")
)
.annotate(
attachment_count=IssueAttachment.objects.filter(
issue=OuterRef("id")
)
.order_by()
.annotate(count=Func(F("id"), function="Count"))
.values("count")
)
) )
state_distribution = ( state_distribution = (