[rt-users] Automatically opening stalled RT tickets

Tom Lanyon tom at netspot.com.au
Sun Jul 20 23:44:03 EDT 2008

On 17/07/2008, at 12:45 AM, Matthew Macdonald-Wallace wrote:

> Hi Tom,
> Please forgive the intrusion into your inbox, I noticed your post  
> dated
> 23rd June on the rt-users list archives and I am very interested in
> your usage of rt-crontool to automatically re-open any stalled tickets
> older than a certain age.
> Would it be possible for you to share the command-line arguments you
> have used for rt-crontool with the community?
> Thanks in advance,
> Matt

Hi Matt,

No problems - sorry for the delay getting back to you. I've CC'd the  
list as well in case anyone else is curious.

We currently run something like this, once per day:

## Search for tickets that have had no requestor correspondance for  
more than 6 days,
## open them and comment (this will notify ticket owner)
/var/www/rt.domain.com/rt/bin/rt-crontool \
         --search RT::Search::FromSQL \
         --search-arg "Queue = 'Foo' AND Status = 'stalled' AND Told <  
'6 days ago' AND DependsOn IS NULL" \
         --action RT::Action::OpenTicketAndComment --action-arg "Auto- 
opened due to being stalled for > 6 days."

You'll also notice the RT::Action::OpenTicketAndComment action which  
is just a slightly modified RT::Action::AutoOpen so that we can also  
place a comment in the ticket to show why it was re-opened. I've  
attached our local/lib/RT/Action/OpenTicketAndComment.pm module if  
you're interested.

Caution: we added the 'DependsOn IS NULL' clause because this was re- 
opening tickets that were stalled because they depended on another  
ticket. However, through TicketSQL we are unable to query the status  
of these depended-on tickets, so currently this won't re-open stalled  
tickets even if a depended-on ticket is resolved. I consider this a  
bug with our process and plan to fix it by using a custom RT::Search  
module to do a more fine-grained query, but haven't had time.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenTicketAndComment.pm
Type: text/x-perl-script
Size: 786 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080721/1358894d/attachment.bin>
-------------- next part --------------

More information about the rt-users mailing list