[Rt-commit] rtir branch, 3.2/grouped-cfs-on-create-incident-and-run-investigation, created. 3.2.0-22-gf88fca3d

? sunnavy sunnavy at bestpractical.com
Tue Mar 27 08:12:46 EDT 2018


The branch, 3.2/grouped-cfs-on-create-incident-and-run-investigation has been created
        at  f88fca3d24f0a3e64359db85c1f0977072df199e (commit)

- Log -----------------------------------------------------------------
commit f88fca3d24f0a3e64359db85c1f0977072df199e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Mar 27 05:57:23 2018 +0800

    Massage grouped CF inputs too on "Create Incident and run Investigation"
    
    On "Create Incident and run Investigation", the form contains CF values
    for both queues. We need to filter out CF inputs that are not applied to
    the current queue, so on CreateTicket call, RT could get a clean %ARGS
    and not issue the error log of:
    
        Invalid context object RT::Queue (5) for CF 2; skipping CF
    
    Previously it doesn't consider CF groupings, this commit fixes this.

diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 9657e919..c9221f87 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -276,12 +276,10 @@ if ( ($DefaultsNamePrefix||'') ne $NamePrefix ) {
         Abort('Queue not found');
     }
 
-    my $prefix = 'Object-RT::Ticket--CustomField-';
-
     my %cf_map;
     foreach my $k( keys %ARGS ) {
-        next unless $k =~ /^\Q$prefix\E(\d+)(.*?)$/;
-        my ($cf_id, $rest) = ($1, $2);
+        next unless $k =~ /^(Object-RT::Ticket--CustomField(?::.+)?-)(\d+)(.*?)$/;
+        my ($prefix, $cf_id, $rest) = ($1, $2, $3);
 
         unless ( exists $cf_map{ $cf_id } ) {
             my $src_cf = $queue->LoadCustomFieldByIdentifier($cf_id);

-----------------------------------------------------------------------


More information about the rt-commit mailing list