fix: added issue in the payload

This commit is contained in:
NarayanBavisetti 2023-09-12 21:30:05 +05:30
parent dabd83a3ce
commit 5b13af30ea
3 changed files with 7 additions and 6 deletions

View File

@ -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,

View File

@ -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)

View File

@ -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"),
)
)