X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FAction%2FCreateTickets.pm;h=e1c6f4a9b2c2d9a0ef5aaf7d0eb3ffcfd47ab39e;hb=refs%2Ftags%2FRT_3_0_9;hp=0ab2067711701f02c09a05ad32e760d4efc9f8cc;hpb=945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd;p=freeside.git diff --git a/rt/lib/RT/Action/CreateTickets.pm b/rt/lib/RT/Action/CreateTickets.pm index 0ab206771..e1c6f4a9b 100644 --- a/rt/lib/RT/Action/CreateTickets.pm +++ b/rt/lib/RT/Action/CreateTickets.pm @@ -41,7 +41,7 @@ Create one or more tickets according to an externally supplied template. ===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 @@ -84,13 +84,13 @@ After each ticket is created, it's stuffed into a hash called %Tickets 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 @@ -128,8 +128,8 @@ A convoluted example 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 @@ -139,7 +139,7 @@ A convoluted example 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 @@ -239,8 +239,8 @@ my $approvals = 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 @@ -431,6 +431,8 @@ sub Commit { $args{'requestor'} ||= $self->TicketObj->Requestors->MemberEmailAddresses; + $args{'type'} ||= 'ticket'; + my %ticketargs = ( Queue => $args{'queue'}, Subject=> $args{'subject'}, Status => 'new', @@ -452,7 +454,7 @@ sub Commit { foreach my $key (keys(%args)) { - $key =~ /^customfield-(\d+)$/ or next; + $key =~ /^customfield(\d+)$/ or next; $ticketargs{ "CustomField-" . $1 } = $args{$key}; }