===Create-Ticket: codereview
Subject: Code review for {$Tickets{'TOP'}->Subject}
- Depended-On-By: {$Tickets{'TOP'}->Id}
+ Depended-On-By: TOP
Content: Someone has created a ticket. you should review and approve it,
so they can finish their work
ENDOFCONTENT
so as to be available during the creation of other tickets during the same
ScripAction. The hash is prepopulated with the ticket which triggered the
ScripAction as $Tickets{'TOP'}; you can also access that ticket using the
-shorthand $TOP.
+shorthand TOP.
A simple example:
===Create-Ticket: codereview
Subject: Code review for {$Tickets{'TOP'}->Subject}
- Depended-On-By: {$Tickets{'TOP'}->Id}
+ Depended-On-By: TOP
Content: Someone has created a ticket. you should review and approve it,
so they can finish their work
ENDOFCONTENT
Queue: Approvals
Type: Approval
AdminCc: {join ("\nAdminCc: ",@admins) }
- Depended-On-By: {$Tickets{"TOP"}->Id}
- Refers-To: {$Tickets{"TOP"}->Id}
+ Depended-On-By: TOP
+ Refers-To: TOP
Subject: Approval for ticket: {$Tickets{"TOP"}->Id} - {$Tickets{"TOP"}->Subject}
Due: {time + 86400}
Content-Type: text/plain
ENDOFCONTENT
===Create-Ticket: two
Subject: Manager approval
- Depended-On-By: {$Tickets{"TOP"}->Id}
+ Depended-On-By: TOP
Refers-On: {$Tickets{"approval"}->Id}
Queue: Approvals
Content-Type: text/plain
Queue: Approvals
Type: Approval
AdminCc: {join ("\nAdminCc: ",@admins) }
-Depended-On-By: {$Tickets{"TOP"}->Id}
-Refers-To: {$Tickets{"TOP"}->Id}
+Depended-On-By: TOP
+Refers-To: TOP
Subject: Approval for ticket: {$Tickets{"TOP"}->Id} - {$Tickets{"TOP"}->Subject}
Due: {time + 86400}
Content-Type: text/plain
$args{'requestor'} ||= $self->TicketObj->Requestors->MemberEmailAddresses;
+ $args{'type'} ||= 'ticket';
+
my %ticketargs = ( Queue => $args{'queue'},
Subject=> $args{'subject'},
Status => 'new',
foreach my $key (keys(%args)) {
- $key =~ /^customfield-(\d+)$/ or next;
+ $key =~ /^customfield(\d+)$/ or next;
$ticketargs{ "CustomField-" . $1 } = $args{$key};
}