[WEB-4726] fix: intake work item redirection (#7619)
* chore: added is intake for email notifications * fix: intake work item redirection * chore: code refactor * chore: code refactor --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
parent
e86b40ac82
commit
d0f26f8734
5 changed files with 26 additions and 4 deletions
|
|
@ -51,6 +51,7 @@ from plane.db.models import (
|
|||
IssueRelation,
|
||||
IssueAssignee,
|
||||
IssueLabel,
|
||||
IntakeIssue,
|
||||
)
|
||||
from plane.utils.grouper import (
|
||||
issue_group_values,
|
||||
|
|
@ -1223,7 +1224,7 @@ class IssueDetailIdentifierEndpoint(BaseAPIView):
|
|||
|
||||
# Fetch the issue
|
||||
issue = (
|
||||
Issue.issue_objects.filter(project_id=project.id)
|
||||
Issue.objects.filter(project_id=project.id)
|
||||
.filter(workspace__slug=slug)
|
||||
.select_related("workspace", "project", "state", "parent")
|
||||
.prefetch_related("assignees", "labels", "issue_module__module")
|
||||
|
|
@ -1315,6 +1316,16 @@ class IssueDetailIdentifierEndpoint(BaseAPIView):
|
|||
)
|
||||
)
|
||||
)
|
||||
.annotate(
|
||||
is_intake=Exists(
|
||||
IntakeIssue.objects.filter(
|
||||
issue=OuterRef("id"),
|
||||
status__in=[-2, 0],
|
||||
workspace__slug=slug,
|
||||
project_id=project.id,
|
||||
)
|
||||
)
|
||||
)
|
||||
).first()
|
||||
|
||||
# Check if the issue exists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue