Navigation Menu

Skip to content

Commit

Permalink
fix: Activity message generation for team assignemnt automation (#5846)
Browse files Browse the repository at this point in the history
  • Loading branch information
tejaswinichile committed Nov 11, 2022
1 parent 6aba352 commit efceaec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/concerns/activity_message_handler.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -84,6 +84,7 @@ def generate_team_name_for_activity
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
Expand All @@ -108,7 +109,7 @@ def create_assignee_change_activity(user_name)
::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
Expand Down

0 comments on commit efceaec

Please sign in to comment.