From efceaec9500152aafc53fb30fa5254b5bff9c3c9 Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Fri, 11 Nov 2022 19:07:24 +0530 Subject: [PATCH] fix: Activity message generation for team assignemnt automation (#5846) --- app/models/concerns/activity_message_handler.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/activity_message_handler.rb b/app/models/concerns/activity_message_handler.rb index 59bc3e5e5..c783580d1 100644 --- a/app/models/concerns/activity_message_handler.rb +++ b/app/models/concerns/activity_message_handler.rb @@ -6,7 +6,7 @@ module ActivityMessageHandler def create_activity user_name = Current.user.name if Current.user.present? status_change_activity(user_name) if saved_change_to_status? - create_label_change(label_activity_message_ownner(user_name)) if saved_change_to_label_list? + create_label_change(activity_message_ownner(user_name)) if saved_change_to_label_list? end def status_change_activity(user_name) @@ -84,6 +84,7 @@ module ActivityMessageHandler end def create_team_change_activity(user_name) + user_name = activity_message_ownner(user_name) return unless user_name key = generate_team_change_activity_key @@ -108,7 +109,7 @@ module ActivityMessageHandler ::Conversations::ActivityMessageJob.perform_later(self, activity_message_params(content)) if content end - def label_activity_message_ownner(user_name) + def activity_message_ownner(user_name) user_name = 'Automation System' if !user_name && Current.executed_by.present? user_name end