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

Round Robin Feature

Hello,
I've only been able to find 1 post about this and there wasn't much discussion in it.

We want to use osTicket as a sales ticket system rather than a support ticket system. So emails will come in / web forms submitted, but we want the tickets to be given to the next sales person in line; rather than having it be a free for all fight over the best commissioned sale.

is a Round Robin system a possibility? is it on your road map? We've seen that other ticket systems have this feature, just wondering if there could be further discussion about it here.

Comments

  • edited April 2014
    We use it for sales.. but have never thought about implementing that.. in what way would you do it?
    It might make a good plugin. That way you could have a different round robin for each department. 
    You might need several staff working on a specific "topic" of ticket for each department.. you could implement a custom ticket-filter to do it.

    For instance, you could create a new team "sales-rr", "sales-queries-rr" for each "round-robin queue" and add the staff to it, then keep the last assigned staff member per queue in a variable somewhere, whenever you get a new ticket for a team ending in -rr, simply check the appropriate list, find the next member and assign the new ticket to them.. could work.

    // psuedocode..
    $ticket; // should be available to a ticket-filter, might not be called this.
    $queue_name = $ticket->getTeam;
    // see if team/queue name ends in -rr otherwise don't use round-robin system.
    if (substr_compare ( $queue_name, '-rr', - 3, strlen ( $queue_name ) ) === 0) {
    	$team = new Team ( $ticket->getTeamId() ); // generally.. needs work!
    	// check the last assignment
    	$last_assignment_id = db_query (); // ... SELECT rr_queues_$queue_name FROM My_VARS .. or something
    	$assign_to_next_staff_member = false;
    	$members = $team->getMembers();
    	foreach ( $members as $staff ) {
    		if ($assign_to_next_staff_member) { //if this is the one immediately following the last assigned staff, use it!
    			assign_ticket($ticket,$staff);
    			break;
    		}
    		if ($last_assignment_id == $staff->id) {//check each staff in team to see if they were the last one assigned a ticket
    			$assign_to_next_staff_member = true;
    		}
    	}
    	if(!$ticket->isAssigned && $assign_to_next_staff_member){
    		//last member of team was assigned for the last ticket, assign to first staff member.
    		assign_ticket($ticket,$members[0]);
    	}
    	if(!$ticket->isAssigned()){
    		$ost->logError('Failed to assign ticket to round-robin queue ' . $queue_name, 'Ticket: ' . $ticket->id);
    	}
    }
    
    function assign_ticket($ticket,$staff){
    	$ticket->assignToStaff ( $staff, 'Auto-Assigned by round robin' );
    	db_query (); // update myvars... save the $staff->id to the table..
    }
    
Sign In or Register to comment.