[rt-users] Scrip to auto-resolve a ticket based on subject

Terence Monteiro terence at deeproot.co.in
Fri Jul 31 05:54:41 EDT 2009


On Fri, Jul 31, 2009 at 06:07:37PM +1000, David Hooton wrote:
> Hi all,
> 
> So far I've created a scrip in our Backup queue which looks like this:
> 
> my $match = "Backup Report [Successful]";

First the square brackets have to be escaped. You want 
    "Backup Report \[Successful\]"

> my $t_subject = $self->TicketObj->Subject;
> if ( $t_subject !~ /$match/i ) {
>    return 0;
> }
> else {
>    return 1;
> }

Also, Perl return value for true is 1 and if you want the scrip to
execute for subject matching, you'll want to put return 1 inside the if
body.

> In Custom action preparation code I have nothing.
> 
> In Custom action cleanup code I have:
> 
> $self->TicketObj->SetStatus( "resolved"); return 1;
 
Also I would advise you to set the action to resolve ticket
instead of user defined, since I would expect you to have a resolve
ticket available by default. Hope this helps.

-- 
Regards, Terence.
http://www.deeproot.in 
Ph: +91 (80) 4089 0000




More information about the rt-users mailing list