From 0cd6d9d570a5dc0d2e4b5f071fbdaec027056e42 Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Thu, 13 Apr 2023 17:49:09 +0530 Subject: [PATCH] fix: parent issue search --- apiserver/plane/api/views/search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apiserver/plane/api/views/search.py b/apiserver/plane/api/views/search.py index b8767ef34..f73a3c9c8 100644 --- a/apiserver/plane/api/views/search.py +++ b/apiserver/plane/api/views/search.py @@ -221,6 +221,10 @@ class IssueSearchEndpoint(BaseAPIView): issue = Issue.objects.get(pk=issue_id) issues = issues.filter( ~Q(pk=issue_id), ~Q(pk=issue.parent_id), parent__isnull=True + ).exclude( + pk__in=Issue.objects.filter(parent__isnull=False).values_list( + "parent_id", flat=True + ) ) if blocker_blocked_by == "true" and issue_id: issues = issues.filter(blocker_issues=issue_id, blocked_issues=issue_id)