From fddb3c70c5247f3eaf5939dfa5c02be9ab0a451c Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 31 Dec 2014 14:28:33 -0600
Subject: [PATCH] ticket: No team alert on new ticket if assigned to an agent
 too

If a new ticket is assigned to both an individual agent and a team, do not
send the email alert to the team lead or the team members.
---
 include/class.ticket.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index f2d60bd4c..a017a7b57 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -2711,7 +2711,9 @@ class Ticket {
             if ($vars['staffId'])
                  $ticket->assignToStaff($vars['staffId'], _S('Auto Assignment'));
             if ($vars['teamId'])
-                $ticket->assignToTeam($vars['teamId'], _S('Auto Assignment'));
+                // No team alert if also assigned to an individual agent
+                $ticket->assignToTeam($vars['teamId'], _S('Auto Assignment'),
+                    !$vars['staffId']);
         }
 
         // Apply requested status — this should be done AFTER assignment,
-- 
GitLab