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