Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Team Tickets don't show as "my ticket" if also assigned to an Agent.

In osticket we have a team X (basicaly 3rd-Level-Support) which stretches over several Departments.
Usually the workflow is like this: Ticket comes in and is assigned to a supporter. Supporter investigates the issue and sometimes comes to the conclusion that he needs in-depth technical help. He then assigns the ticket to the team X . The ticket stays in the Support department since it's technically still a support case that needs further investigation by team X, the supporter is still responsible for communication with the client.

Problem is that the ticket does not show under MyTickets for Team X because it is at the same time assigned to the original agent (also cant be unassigned easily), so it usually takes Team X a while to see that there is a Ticket that needs their attention. Is it possible to make these Tickets appear under "my Ticktes" for Team X like it would if it is only assigned to the team and has no agent?


  • Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.

    Tickets assigned to an Agent... aren't not your tickets.  They are the Agents that they are assigned to.

    Additionally tickets can also be assigned to a Department or a Team.  Then they are visible to both the Agent and the assigned Department/Team.
  • I'm sorry, maybe I didn't explain it right.

    If I'm in a team and the ticket is assigned to the team, it should list under owned tickets regardless of the agent assigned, (there's no I in Team, right? ;)). From what I understand the ticket should not only be visible to the team members but also count to their assigned tickets. And it works exactly like that as long as the ticket is ONLY assigned to a team. As soon as an agent is assigned  it's not listed under owned tickets anymore, doesn't matter if in team or not (except if you're the owner of course) although I'm still technically owning the ticket through my team. It's still listed under open tickets of course.
    Unfortunately a normal agent can't free a ticket himself and then assign it to the team only.

    You can easily reproduce this by having two departments. Support and a second one, Development in my case. You have an Agent A1 in Support an some in Development, also a Team X that consists of some members of the Development department, lets say D1 to D4.
    Now when A1 creates a ticket in the support department without assigning it to an agent but to team X instead, the agents D1 to D4 get the new ticket listed under their owned tickets.
    But usually it works like this: An email comes in and automatically creates a ticket that is assigned to agent A1. A1 now assigns the same ticket to Team X. Agent D1 to D4 can see the ticket in open tickets, (if they pay attention) but cant see that it's actually assigned to them.

    We're using osticket version 1.10, php 5.5.38, currently running in a XAMPP environment for evaluation; if that helps.
  • "As soon as an agent is assigned  it's not listed under owned tickets anymore, doesn't matter if in team or not (except if you're the owner of course) although I'm still technically owning the ticket through my team."

    Yes, as soon as you assign it to someone else... you are no longer have access to it unless its assigned to a Department or Team that you have access to.  Ticket "owners" are Users not Agents, so this assumption that you own the ticket is inaccurate.  Tickets that aren't assigned to you aren't "yours".
  • Sorry, I got the terminology wrong. With owner I mean assignee not the user.

    From my perspective a ticket assigned to my team should be treated as it's also assigned to me, because it is in a way. And it works like that as long as it's team only (no agent assigned). I thought of a team as a way to assign a ticket to multiple agents in a convenient way.

    Anyway, I get that this is probably not possible. At the moment I work around the issue by creating a filter for the custom search. But unfortunately I would have to do this for every agent there is and will come.
  • mihaly, I'm having the exact same issue. I know exactly what you're talking about. 
  • edited September 2017
    So what I did to solve this is I changed some code in the php files.

    In include\staff\ on line 105 I added
    'team_id__in' => $thisstaff->getTeams(),
    to the filter conditions so it should look something like this:
    Q::all(array('staff_id' => 0, 'team_id__gt' => 0)),
    'team_id__in' => $thisstaff->getTeams(), // NOTE: monkey patched
    Now team tickets should appear as assigned to any agent in the team, regardless of the actual agent assigned.

    To also include the team tickets in the ticket counter in the tab-bar I edited include\class.ticket.php on line 2957. I just commented out the check for the staff-id.

    I simply changed line 2957 from
    && $S['staff_id'] == 0
    //&& $S['staff_id'] == 0
    Now the whole condition should look something like this:
    elseif ($S['team_id']
    //&& $S['staff_id'] == 0
    && $teams
    && in_array($S['team_id'], $teams))
    // NOTE: Changed to include assigned team tickets. Originally didn't count assigned team tickets
    $stats['assigned'] += $S['count'];
    Now Team tickets appear under My Tickets for every team member and the assigned agent :3

  • edited September 2017
    Apparently my "Fix" breaks the ticket view for agents that are not in a team. So I made a fix for my fix.

    I added a check for staff teams and only add the team filter when the agent actually is in a team.

    My code in include\staff\  on line 99 and following, now looks like this (my new code in blue, removed code in red):
    case 'assigned':
    $results_type=__('My Tickets');

    // original filter
    Q::all(array('staff_id' => 0, 'team_id__gt' => 0)),

    // Default filter
    $ticket_filter = array(
    Q::all(array('staff_id' => 0, 'team_id__gt' => 0)),

    $staff_teams = $thisstaff->getTeams();

    // Add lookup only for teams if agent is in one
    $ticket_filter['team_id__in'] = $staff_teams;

    // add filter back in

    $queue_sort_options = array('updated', 'priority,updated',
    'priority,created', 'priority,due', 'due', 'answered', 'number',
Sign In or Register to comment.