[Rt-commit] r3718 - in rt/branches/QUEBEC-EXPERIMENTAL: . lib/RT/Action

jesse at bestpractical.com jesse at bestpractical.com
Wed Aug 24 01:32:57 EDT 2005


Author: jesse
Date: Wed Aug 24 01:32:56 2005
New Revision: 3718

Modified:
   rt/branches/QUEBEC-EXPERIMENTAL/   (props changed)
   rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Action/CreateTickets.pm
Log:
 r13741 at hualien:  jesse | 2005-08-24 01:28:59 -0400
 * Added support for named custom fields in templates
 


Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Action/CreateTickets.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Action/CreateTickets.pm	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Action/CreateTickets.pm	Wed Aug 24 01:32:56 2005
@@ -1070,8 +1070,13 @@
     }
 
     foreach my $key ( keys(%args) ) {
-        $key =~ /^customfield(\d+)$/ or next;
+       if ( $key =~ /^customfield(\d+)$/ ) {
         $ticketargs{ "CustomField-" . $1 } = $args{$key};
+        } elsif ($key =~ /^(customfield|cf)(.*)$/) {
+            my $cf = RT::CustomField->new($self->CurrentUser);
+            $cf->LoadByName(Name => $args{$key} , Queue => $ticketargs{Queue});
+            $ticketargs{ "CustomField-".$cf->id } = $args{$key};
+        }
     }
 
     $self->GetDeferred( \%args, $template_id, $links, $postponed );


More information about the Rt-commit mailing list