From 5b13af30ea7469134dbd3af11a22be8ac1248c88 Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Tue, 12 Sep 2023 21:30:05 +0530 Subject: [PATCH] fix: added issue in the payload --- apiserver/plane/api/views/issue.py | 2 +- apiserver/plane/api/views/search.py | 3 ++- apiserver/plane/bgtasks/issue_activites_task.py | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index ebf0b9754..918d7a55e 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -2076,7 +2076,7 @@ class IssueRelationViewSet(BaseViewSet): issueRelation = IssueRelation.objects.bulk_create( [ IssueRelation( - issue_id=issue_id, + issue_id=related_issue["issue"], related_issue_id=related_issue["related_issue"], relation_type=related_issue["relation_type"], project_id=project_id, diff --git a/apiserver/plane/api/views/search.py b/apiserver/plane/api/views/search.py index c9634a84a..8c1643794 100644 --- a/apiserver/plane/api/views/search.py +++ b/apiserver/plane/api/views/search.py @@ -251,7 +251,8 @@ class IssueSearchEndpoint(BaseAPIView): issue = Issue.issue_objects.get(pk=issue_id) issues = issues.filter( ~Q(pk=issue_id), - ~Q(issue_related__related_issue=issue), + ~Q(issue_related__issue=issue), + ~Q(issue_relation__related_issue=issue), ) if sub_issue == "true" and issue_id: issue = Issue.issue_objects.get(pk=issue_id) diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index 45b6038ba..2d13afc35 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -1056,7 +1056,7 @@ def create_issue_relation_activity( issue = Issue.objects.get(pk=issue_relation.get("related_issue")) issue_activities.append( IssueActivity( - issue_id=issue_id, + issue_id=issue_relation.get("issue"), actor=actor, verb="created", old_value="", @@ -1065,7 +1065,7 @@ def create_issue_relation_activity( project=project, workspace=project.workspace, comment=f'added {issue_relation.get("relation_type")} relation', - old_identifier=issue_id, + old_identifier=issue_relation.get("issue"), ) ) @@ -1081,7 +1081,7 @@ def delete_issue_relation_activity( issue = Issue.objects.get(pk=current_instance.get("issue")) issue_activities.append( IssueActivity( - issue_id=issue_id, + issue_id=current_instance.get("issue"), actor=actor, verb="deleted", old_value=f"{project.identifier}-{issue.sequence_id}", @@ -1090,7 +1090,7 @@ def delete_issue_relation_activity( project=project, workspace=project.workspace, comment=f'deleted the {current_instance.get("relation_type")} relation', - old_identifier=issue_id, + old_identifier=current_instance.get("issue"), ) )