[rt-users] Two separate tickets for one mail

Martin Drasar drasar at ics.muni.cz
Thu Jan 20 11:03:02 EST 2011


Dne 20.1.2011 16:00, Steve Anderson napsal(a):
> One option is to use a scrip tied to the creation of a ticket.
> 
> We've got a workflow on our advert management queue, which creates a child ticket to remove an advert. It checks for Set-Removal: followed by a unix timestamp, and if it exist, a child ticket is created. There's a snippet of the code below. It's in Custom action preparation code. Condition on create, action user defined.
> 
> 
> 
> if( $content =~ m/^\QSet-Removal:\E\s*(\S+)\s*$/m ) {
> my $removaldate = RT::Date->new($RT::SystemUser);
>       my $starts = RT::Date->new($RT::SystemUser);
>       $removaldate->Set(Format=>'unix', Value=>$1);
>       my $rdate=$removaldate->ISO;
>       $starts->Set(Format=>'unix', Value=>$removaldate->AddDays(-7));
>       my $childticket=new RT::Ticket($RT::SystemUser);
>       $childticket->Create(Queue=>"WebChange",
>                            Requestor=>$self->TicketObj->RequestorAddresses,
>                            Subject=>"Remove Advert",
>                            Due=>$rdate,
>                            Starts=>$starts->ISO
>                            );
>       $childticket->AddLink(Type=>"MemberOf",Target=>$self->TicketObj->id)
> }
> 
> 
> Steve Anderson

Hi Steve,

thanks for the code, it looks good. I think that it should be pretty
straightforward from now.

Martin

-- 
Mgr. Martin Drasar                                   drasar at ics.muni.cz
CSIRT-MU, Network Security Department          http://www.muni.cz/csirt
Institute of Computer Science, Masaryk University, Brno, Czech Republic
                       PGP Key ID: 0xB2761CDE



More information about the rt-users mailing list