RT::Action::IncrementPriority - will increment a ticket's priority by 1 each time it is run.
IncrementPriority is a ScripAction that will increment a ticket's current priority by one, unless the ticket's FinalPriority is set to a non-zero value and the ticket's Priority has already reached or exceeded the FinalPriority.
This action is intended to be called by an RT escalation tool. One such tool is called rt-crontool and is located in $RTHOME/bin (see rt-crontool -h for more details).
rt-crontool -h
Once the ScripAction is installed, the following script in "cron" will increment priority for all 'new' or 'open' tickets:
rt-crontool --search RT::Search::FromSQL --search-arg \ "(Status='new' OR Status='open')" \ --action RT::Action::IncrementPriority
IncrementPriority's behavior can be controlled by two options:
You cannot set "UpdateLastUpdated" to false unless "RecordTransaction" is also false. Well, you can, but we'll just ignore you.
You can set this options using either in RT_SiteConfig.pm, as action argument in call to the rt-crontool or in DB if you want to use the action in scrips.
From a shell you can use the following command to silently increment the priority of all tickets with either 'new' or 'open' Status:
rt-crontool --search RT::Search::FromSQL \ --search-arg "(Status='new' OR Status='open')" \ --action RT::Action::IncrementPriority \ --action-arg "UpdateLastUpdated: 0"
Or alternatively, to do the same thing but to update the LastUpdated timestamp and record a transaction, you could run:
rt-crontool --search RT::Search::FromSQL \ --search-arg "(Status='new' OR Status='open')" \ --action RT::Action::IncrementPriority \ --action-arg "RecordTransaction: 1"
This ScripAction uses RT's internal _Set or __Set calls to set ticket priority without running scrips or recording a transaction on each update, if it's been said to.
Joshua C. Randall <jcrandall@alum.mit.edu>
Kevin Riggle <kevinr@bestpractical.com>
Ruslan Zakirov <ruz@bestpractical.com>
To install RT::Extension::IncrementPriority, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RT::Extension::IncrementPriority
CPAN shell
perl -MCPAN -e shell install RT::Extension::IncrementPriority
For more information on module installation, please visit the detailed CPAN module installation guide.