Auto-assigning agents to new tickets

When a client submits a ticket, HelpWP can automatically assign an agent so the ticket does not sit unowned in the queue. Assignment is configurable under HelpWP -> Settings -> Tickets -> Agent assignment.

Enabling auto-assignment

The Auto-assign tickets checkbox controls whether assignment runs at all. When it is off, every new ticket is left unassigned until an agent picks it up manually.

Assignment strategies

Three strategies are available. Select one under Settings -> Tickets -> Agent assignment -> Assignment strategy:

StrategyBehaviour
RandomPicks any available agent at random. The default.
Round-robinRotates through agents in order. The current position is stored in the option helpwp_rr_agent_pointer and advances on each assignment.
Least-loadedCounts each eligible agent’s currently open tickets and assigns to the one with the fewest.

All three strategies share the same eligibility check: if Max open tickets per agent is set to a non-zero value, agents whose open ticket count is at or above that limit are excluded before the strategy runs. If no eligible agents remain after filtering, the ticket is left unassigned.

Max open tickets per agent

Set a cap under Settings -> Tickets -> Agent assignment -> Max open tickets per agent. Any agent at or above this limit is skipped during auto-assignment. Leave the field empty (or set to 0) for no cap.

The picker function

The logic lives in helpwp_pick_agent() in app/Helper/functions.php. It runs once, when the ticket is first created. Subsequent comments do not re-pick the agent.

Reassigning a ticket

Auto-assignment is just a starting point. An agent can reassign:

  • Quick edit in the admin ticket list (Agent column).
  • Edit ticket screen, Agent field in the meta box.
  • REST PUT to /wp-json/helpwp/v1/tickets/{id} with agent: <user_id>.

Reassigning fires the action helpwp-tickets-agent_changed with two arguments: new agent ID, old agent ID.

What if there are no agents

Tickets without an agent appear in the list with Unassigned in the agent column. They are still searchable, replyable, and can be assigned manually later. The “New ticket – to agent” notification email is skipped (there is no recipient).

Override the picker

If you want custom assignment logic — based on workload, the client’s product, agent availability, etc. — hook into ticket creation at a later priority and overwrite the assigned agent:

add_action( 'helpwp-tickets-ticket_created', function( $ticket ) {
    $best_agent_id = my_smart_picker( $ticket );
    $ticket->set_agent( $best_agent_id );
}, 20 ); // priority 20 runs after the default pick

Was this doc helpful?

Scroll to Top