From f79fdbf78208ad41c85309e65d6ea5ac052ad269 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 30 Mar 2023 18:58:51 +0530 Subject: [PATCH] chore: create activity when a block is converter into an issue (#609) --- apiserver/plane/api/views/page.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apiserver/plane/api/views/page.py b/apiserver/plane/api/views/page.py index 7b6ebea53..525229bf6 100644 --- a/apiserver/plane/api/views/page.py +++ b/apiserver/plane/api/views/page.py @@ -21,6 +21,7 @@ from plane.db.models import ( PageFavorite, Issue, IssueAssignee, + IssueActivity, ) from plane.api.serializers import ( PageSerializer, @@ -213,6 +214,15 @@ class CreateIssueFromPageBlockEndpoint(BaseAPIView): _ = IssueAssignee.objects.create( issue=issue, assignee=request.user, project_id=project_id ) + + _ = IssueActivity.objects.create( + issue=issue, + actor=request.user, + project_id=project_id, + comment=f"{request.user.email} created the issue from {page_block.name} block", + verb="created", + ) + page_block.issue = issue page_block.save()