Open Overdue Tickets

I’d like to write a simple cron job to auto-set all overdue stalled
tickets back to Open.

This seems like it should be fairly simple, but I’m falling down
somewhat.

I would expect this to be something like:

    rt-crontool --search RT::Search::ActiveTicketsInQueue \
        --search-arg support \
        --condition RT::Condition::Overdue \
        --condition-arg \
        --action RT::Action::SetStatus \
        --action-arg open

However, there is no RT::Action::SetStatus.

Now, I believe that this would be fairly trivial to write (very much
like RT::Action::SetPriority), except I find it difficult to believe
that there isn’t something shipped with RT that does this, leading me to
think I must be looking in the wrong place.

Do I really need to write RT::Action::SetStatus, or should I be doing
something else?

Tony

I’d like to write a simple cron job to auto-set all overdue stalled
tickets back to Open.

This seems like it should be fairly simple, but I’m falling down
somewhat.

I would expect this to be something like:

    rt-crontool --search RT::Search::ActiveTicketsInQueue \
        --search-arg support \
        --condition RT::Condition::Overdue \
        --condition-arg \
        --action RT::Action::SetStatus \
        --action-arg open

However, there is no RT::Action::SetStatus.

RT::Action::AutoOpen should do what you want.

But if the ticket is stalled for a reason, simply changing it to Open
isn’t going to change the reason it was stalled. Increase the
priority so that important tickets that are stalled get the attention
they need.
Andy Harrison

I’d like to write a simple cron job to auto-set all overdue stalled
tickets back to Open.
However, there is no RT::Action::SetStatus.

RT::Action::AutoOpen should do what you want.

Well, I’m not sure I want a comment saying “auto-opened on incoming
correspondence”. And what about the times when I want to set to New or
Stalled from cron?

But if the ticket is stalled for a reason, simply changing it to Open
isn’t going to change the reason it was stalled. Increase the
priority so that important tickets that are stalled get the attention
they need.

That’s not the way our workflow deals with this. Every ticket that is
stalled has a date to ‘re-visit’ the ticket. It’s generally used when we
respond to a customer and want to set a follow-up date in case the
customer doesn’t respond. The ticket will get attention again if (a) the
customer responds (which will open the ticket), or (b) the Due Date
arrives, in which case this cron job will re-open it.

Tony

RT::Action::AutoOpen should do what you want.

Well, I’m not sure I want a comment saying “auto-opened on incoming
correspondence”. And what about the times when I want to set to New or
Stalled from cron?

Copy <RT_DIR>/lib/RT/Action/AutoOpen.pm to
<RT_DIR>/local/lib/RT/Action/ and change it to suit your needs. You
could also use that as an example and make new actions for
AutoSetStall or AutoSetNew or something.

But if the ticket is stalled for a reason, simply changing it to Open
isn’t going to change the reason it was stalled. Increase the
priority so that important tickets that are stalled get the attention
they need.

That’s not the way our workflow deals with this. Every ticket that is
stalled has a date to ‘re-visit’ the ticket. It’s generally used when we
respond to a customer and want to set a follow-up date in case the
customer doesn’t respond. The ticket will get attention again if (a) the
customer responds (which will open the ticket), or (b) the Due Date
arrives, in which case this cron job will re-open it.

You could just have it notify appropriately when the due date arrives.

Example:

./rt-crontool --verbose --search RT::Search::FromSQL --search-arg
"Queue = 38 AND Status != ‘resolved’ AND Status != ‘rejected’ and due
< 1000 " --action
RT::Action::SetPriority --action-arg 60

Just change the action to use RT::Action::Notify.

Andy Harrison

<RT_DIR>/local/lib/RT/Action/ and change it to suit your needs. You
could also use that as an example and make new actions for
AutoSetStall or AutoSetNew or something.

nod. As I said originally, Action/SetStatus isn’t hard to write. I
was just surprised it didn’t already exist and thought perhaps I was
missing something. I’ll go ahead and write it, but I think it shoul dbe
something that gets shipped by default.

You could just have it notify appropriately when the due date arrives.
Example:
./rt-crontool --verbose --search RT::Search::FromSQL --search-arg
"Queue = 38 AND Status != ‘resolved’ AND Status != ‘rejected’ and due
< 1000 " --action
RT::Action::SetPriority --action-arg 60

That doesn’t meet our business requirements.

Thanks,

Tony

I use the attached script called from cron every 15 minutes.

-=| Ben-----Original Message-----

From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Tony Bowden
Sent: Sunday, December 05, 2004 5:40 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Open Overdue Tickets

I’d like to write a simple cron job to auto-set all overdue stalled
tickets back to Open.

This seems like it should be fairly simple, but I’m falling down
somewhat.

I would expect this to be something like:

    rt-crontool --search RT::Search::ActiveTicketsInQueue \
        --search-arg support \
        --condition RT::Condition::Overdue \
        --condition-arg \
        --action RT::Action::SetStatus \
        --action-arg open

However, there is no RT::Action::SetStatus.

Now, I believe that this would be fairly trivial to write (very much
like RT::Action::SetPriority), except I find it difficult to believe
that there isn’t something shipped with RT that does this, leading me to
think I must be looking in the wrong place.

Do I really need to write RT::Action::SetStatus, or should I be doing
something else?

Tony

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT wiki at http://wiki.bestpractical.com

check-due-dates.pl (1.22 KB)

I use the attached script called from cron every 15 minutes.

Thanks.

I found it much simpler, however, to just create this:

package RT::Action::SetStatus;

use strict;
use base ‘RT::Action::Generic’;

sub Describe {
my $class = ref +shift;
return “$class will set a ticket’s status to the argument provided.”;
}

sub Prepare { 1 }

sub Commit {
my $self = shift;
$self->TicketObj->SetStatus($self->Argument);
return 1;
}

1;

and then call:

     rt-crontool --search RT::Search::ActiveTicketsInQueue \
         --search-arg support \
         --condition RT::Condition::Overdue \
         --condition-arg \
         --action RT::Action::SetStatus \
         --action-arg open

Tony