From e232d39f0eb8b46ad74911bc7b20d9965fd8c722 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 13 Apr 2023 00:34:12 +0530 Subject: [PATCH] feat: track estimate points in issue activity (#762) * feat: track estimate points in issue activity * dev: update comment --- .../plane/bgtasks/issue_activites_task.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index e183b60ef..c4fde9646 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -634,6 +634,40 @@ def create_issue_activity( ) +def track_estimate_points( + requested_data, current_instance, issue_id, project, actor, issue_activities +): + if current_instance.get("estimate_point") != requested_data.get("estimate_point"): + if requested_data.get("estimate_point") == None: + issue_activities.append( + IssueActivity( + issue_id=issue_id, + actor=actor, + verb="updated", + old_value=current_instance.get("estimate_point"), + new_value=requested_data.get("estimate_point"), + field="estimate_point", + project=project, + workspace=project.workspace, + comment=f"{actor.email} updated the estimate point to None", + ) + ) + else: + issue_activities.append( + IssueActivity( + issue_id=issue_id, + actor=actor, + verb="updated", + old_value=current_instance.get("estimate_point"), + new_value=requested_data.get("estimate_point"), + field="estimate_point", + project=project, + workspace=project.workspace, + comment=f"{actor.email} updated the estimate point to {requested_data.get('estimate_point')}", + ) + ) + + def update_issue_activity( requested_data, current_instance, issue_id, project, actor, issue_activities ): @@ -651,6 +685,7 @@ def update_issue_activity( "blockers_list": track_blockings, "cycles_list": track_cycles, "modules_list": track_modules, + "estimate_point": track_estimate_points, } requested_data = json.loads(requested_data) if requested_data is not None else None