fix: Activity message generation for team assignemnt automation (#5846)

This commit is contained in:
Tejaswini Chile 2022-11-11 19:07:24 +05:30 committed by GitHub
parent 6aba352e0d
commit efceaec950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ module ActivityMessageHandler
def create_activity def create_activity
user_name = Current.user.name if Current.user.present? user_name = Current.user.name if Current.user.present?
status_change_activity(user_name) if saved_change_to_status? 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 end
def status_change_activity(user_name) def status_change_activity(user_name)
@ -84,6 +84,7 @@ module ActivityMessageHandler
end end
def create_team_change_activity(user_name) def create_team_change_activity(user_name)
user_name = activity_message_ownner(user_name)
return unless user_name return unless user_name
key = generate_team_change_activity_key key = generate_team_change_activity_key
@ -108,7 +109,7 @@ module ActivityMessageHandler
::Conversations::ActivityMessageJob.perform_later(self, activity_message_params(content)) if content ::Conversations::ActivityMessageJob.perform_later(self, activity_message_params(content)) if content
end 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 = 'Automation System' if !user_name && Current.executed_by.present?
user_name user_name
end end