I’m looking to create a scrip which enforces a maximum number of tickets of a certain status, per person, per queue.
For example:
Joe has 3 status open tickets and 4 status stalled tickets. By policy, Joe is only allowed to have 3 open tickets at once.
Joe tries to change 1 of the stalled tickets to open, but RT counts the number of status open tickets that Joe already has and doesn’t allow the status change. If Joe then changes 1 open ticket to resolved, then he can change 1 stalled to open, maintaining his limit of 3 status open tickets.
Has anyone tried enforcing limitation like this or query the status of other tickets in a scrip?
I’m looking to create a scrip which enforces a maximum number of tickets of a certain status, per person, per queue.
For example:
Joe has 3 status open tickets and 4 status stalled tickets. By policy, Joe is only allowed to have 3 open tickets at once.
Joe tries to change 1 of the stalled tickets to open, but RT counts the number of status open tickets that Joe already has and doesn’t allow the status change. If Joe then changes 1 open ticket to resolved, then he can change 1 stalled to open, maintaining his limit of 3 status open tickets.
Has anyone tried enforcing limitation like this or query the status of other tickets in a scrip?
I don’t think you should use scrips for this because it will be asynchrone.
I would do:
set a user or group CustomField to record each ones limits
add a method to local/lib/RT/User_Local.pm named CheckStatusLimit,
that retrieve the user/group limit, get the list of owned tickets and
check if limit are reached, then return if the new status is allowed or not.
use callbacks (Tickt/Display.html and other plaes where user can
change status) or override maybe ProcessTicketBasics, to use this method
before accepting status change. Display proper error to user if not allowed
I would avoid enforcing this in Ticket->SetStatus method as you may
wan’t to allow others to force status or even scripts.