From 6be775434dfdb5201292385feb6580364af99587 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:58:03 +0530 Subject: [PATCH] fix: project issue search endpoint (#729) --- apiserver/plane/api/views/search.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apiserver/plane/api/views/search.py b/apiserver/plane/api/views/search.py index 30139a15a..b8767ef34 100644 --- a/apiserver/plane/api/views/search.py +++ b/apiserver/plane/api/views/search.py @@ -217,9 +217,12 @@ class IssueSearchEndpoint(BaseAPIView): project__project_projectmember__member=self.request.user, ) - if parent == "true": - issues = issues.filter(parent__isnull=True) - if blocker_blocked_by and issue_id: + if parent == "true" and issue_id: + issue = Issue.objects.get(pk=issue_id) + issues = issues.filter( + ~Q(pk=issue_id), ~Q(pk=issue.parent_id), parent__isnull=True + ) + if blocker_blocked_by == "true" and issue_id: issues = issues.filter(blocker_issues=issue_id, blocked_issues=issue_id) return Response(