Joshua Randall
and 1 contributors

NAME

    RT::Action::IncrementPriority - will increment a ticket's priority by 1 each time it is run.

DESCRIPTION

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).

USAGE

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

CONFIGURATION

IncrementPriority's behavior can be controlled by two options:

RecordTransaction - defaults to false and if option is true then causes the tool to create a transaction on the ticket when it is escalated.
UpdateLastUpdated - which defaults to true and updates the LastUpdated field when the ticket is escalated, otherwise don't touch anything.

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.

AUTHORS

Joshua C. Randall <jcrandall@alum.mit.edu>

Kevin Riggle <kevinr@bestpractical.com>

Ruslan Zakirov <ruz@bestpractical.com>