From 025c8b3835d3bb074cabe85745d6716af406b811 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Wed, 22 Mar 2023 01:33:56 +0530 Subject: [PATCH] feat: sub issue toggle (#464) --- apiserver/plane/api/views/issue.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index 9dbcf55d8..b6c265fba 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -175,12 +175,20 @@ class IssueViewSet(BaseViewSet): def list(self, request, slug, project_id): try: filters = issue_filters(request.query_params, "GET") + show_sub_issues = request.GET.get("show_sub_issues", "true") + issue_queryset = ( self.get_queryset() .order_by(request.GET.get("order_by", "created_at")) .filter(**filters) ) + issue_queryset = ( + issue_queryset + if show_sub_issues == "true" + else issue_queryset.filter(parent__isnull=True) + ) + issues = IssueSerializer(issue_queryset, many=True).data ## Grouping the results