[rt-users] Auto-Creating Child Tickets

Drew Barnes barnesaw at ucrwcu.rwc.uc.edu
Tue Sep 18 11:03:18 EDT 2007


IIRC, Custom fields are set in a different transaction than the ticket
creation.  Perhaps this is tripping you up?

Mathew Snyder wrote:
> 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
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
>   



More information about the rt-users mailing list