I'm having the hardest time figuring out how to create a ticket based on
the status of a Custom Field.
I have two Custom Fields
1: Billable
It's a select one field with values of:
Yes
No
Covered
Gratis
2: Followup
It's a select one field with values of:
Yes
No
I have the two corresponding scrips written:
1: Invoice
Condition: User Defined
Action: Create Tickets
Template: Generate-Invoice
Custom Condition:
return 0 unless $trans->Type eq "Resolve";
return undef unless
($self->TicketObj->FirstCu
stomFieldV
alue('Name
_of_your_C
ustom_Fiel
d') =~
/Yes/i);
return 1;
return undef unless
($self->TicketObj->FirstCu
stomFieldV
alue('Name
_of_your_C
ustom_Fiel
d') =~
/Gratis/i);
return 1;
return undef unless
($self->TicketObj->FirstCu
stomFieldV
alue('Name
_of_your_C
ustom_Fiel
d') =~
/Covered/i);
return 1;
2:
Condition: User Defined:
Action: Create Tickets:
Template: generate-followup
Custom Condition:
return 0 unless $trans->Type eq "Resolve";
return undef unless ($self->TicketObj->FirstCu
stomFieldV
alue('Foll
owup')
=~ /Yes/i);
return 1;
I have two corresponding templates created:
1:
===Create-Ticket: generate-invoice
Queue: Accounting
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj
->EmailAdd
ress() }
RefersTo: {$Tickets{'TOP'}->Id() }
Content: Please generate an invoice for this customer.
Billable was set to:
{$Tickets}{'TOP'}->TicketO
bj->FirstC
ustomField
Value('Bil
lable')}
Billable hours was set to:
{$Tickets}{'TOP'}->TicketO
bj->FirstC
ustomField
Value('Bil
lable Hours')}
Please refer to previous ticket for more information.
ENDOFCONTENT
2:
===Create-Ticket: generate-followup
Queue: Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj
->EmailAdd
ress() }
RefersTo: {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket. Please refer to
previous ticket for more information.
ENDOFCONTENT
I then created a test ticket with Billable set to Yes and Followup to
Yes, and neither ticket spawned!!!
Help please!!!
Start Free Trial