[rt-users] Auto-Creating Child Tickets

Mathew Snyder theillien at yahoo.com
Tue Sep 18 11:01:25 EDT 2007


Mathew Snyder wrote:
> I've followed the method laid out in the wiki for automated approvals in order
> to create child tickets.
> 
> I've created the following template:
> ===Create-Ticket: Child
> Subject: {$Tickets{'TOP'}->Subject} - Child
> Depended-on-by: TOP
> Status: new
> Queue: TechOps
> Type: ticket
> Refers-To: {$Tickets{'TOP'}->Id()}
> Content: This is a child ticket
> ENDOFCONTENT
> 
> And a scrip which makes use of it with the following settings:
> Condition: On Create
> Action: Create Tickets
> Template: CreateChild (the template above)
> 
> Custom Condition:
> unless (
>  ( $self->TransactionObj->Type eq "CustomField"
>    &&  $self->TransactionObj->Field == 9 )
>  ||  $self->TransactionObj->Type eq "Create"
>  ) {
>    return 0;
> }
> 
> Custom action preparation code:
> return 0 unless $self->TicketObj->FirstCustomFieldValue('CustomerCare Ticket
> Type') =~ /Provisioning/i;
> 
> Custom action cleanup code:
> return 1;
> 
> What I am looking for it to do is create the child tickets only if the initial
> type of ticket is set to Provisioning.  However, the child ticket is created
> regardless of the ticket type.  I'd also like it to not create a child if the
> ticket comes in via email.
> 
> Can someone point out the problems with my set-up that is causing it to break?
> 
> Thanks
> Mathew

I've changed the logic to:
Custom condition:
if (($self->TransactionObj->Type eq "CustomField" &&
$self->TransactionObj->Field == 9 &&
$self->TicketObj->FirstCustomFieldValue('Ticket Type')) eq "Provisioning")){
 return 1;
} else {
 return 0;
}

Custom action preparation code:
return 1;

Custom action cleanup code:
empty

But still get child tickets created regardless of the value of the "Ticket Type" CF.

Keep up with me and what I'm up to: http://theillien.blogspot.com



More information about the rt-users mailing list