[rt-users] Adjusting priorities

René Seindal rene at seindal.dk
Sun Oct 29 22:36:53 EST 2000

Dear RT-users,

This little script will adjust the priority of all open and non overdue 
tickets towards the final priority. The change is linear so each tickets 
priority moves from the initial priority towards the final priority at a 
constant speed. A tickets priority will only be changed upwards, so a ticket 
that has had its priority raised won't have it lowered automatically. The 
opposite is not true, so a ticket that has been given a lower priority will 
have it raised again.

This script will have no effect on tickets that are not open or stalled, 
tickets without a due date, and tickets where the final priority is equal to 
the initial priority.

mysql rt <<EOF
update each_req set priority=greatest(priority,
*(unix_timestamp()-date_created) +initial_priority))
where date_due > unix_timestamp()
and status in ('open','stalled');

René Seindal (rene at seindal.dk)              http://www.seindal.dk/rene/

More information about the rt-users mailing list