[Rt-commit] rt branch, 4.4/lifecycle-optimization, created. rt-4.4.1-1-gfb987fd

Shawn Moore shawn at bestpractical.com
Thu Mar 30 15:11:34 EDT 2017


The branch, 4.4/lifecycle-optimization has been created
        at  fb987fdedb5b52e5b4369bd22b3ef86becb2d53e (commit)

- Log -----------------------------------------------------------------
commit fb987fdedb5b52e5b4369bd22b3ef86becb2d53e
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Mar 30 19:06:53 2017 +0000

    Include only ticket lifecycles for Status = '__Active__'
    
    For ticket searches with Status = '__Active__' and Status =
    '__Inactive__' it makes no sense to rewrite the query to include any
    assets lifecycles like so:
    
       ( Queues_1.Lifecycle = 'approvals' AND ( LOWER(main.Status) = 'new' OR LOWER(main.Status) = 'open' OR LOWER(main.Status) = 'stalled' ) )
    OR ( Queues_1.Lifecycle = 'default' AND ( LOWER(main.Status) = 'new' OR LOWER(main.Status) = 'open' OR LOWER(main.Status) = 'stalled' ) )
    OR ( Queues_1.Lifecycle = 'assets' AND ( LOWER(main.Status) = 'new' OR LOWER(main.Status) = 'allocated' OR LOWER(main.Status) = 'in-use' ) )

diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 64b0646..9d2f4c4 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -3009,6 +3009,7 @@ sub _parser {
                     my %lifecycle =
                       map { $_ => $RT::Lifecycle::LIFECYCLES{ $_ }{ inactive } }
                       grep { @{ $RT::Lifecycle::LIFECYCLES{ $_ }{ inactive } || [] } }
+                      grep { $RT::Lifecycle::LIFECYCLES_CACHE{ $_ }{ type } eq 'ticket' }
                       keys %RT::Lifecycle::LIFECYCLES;
                     return unless %lifecycle;
 
@@ -3049,7 +3050,9 @@ sub _parser {
                       grep {
                              @{ $RT::Lifecycle::LIFECYCLES{ $_ }{ initial } || [] }
                           || @{ $RT::Lifecycle::LIFECYCLES{ $_ }{ active }  || [] }
-                      } keys %RT::Lifecycle::LIFECYCLES;
+                      }
+                      grep { $RT::Lifecycle::LIFECYCLES_CACHE{ $_ }{ type } eq 'ticket' }
+                      keys %RT::Lifecycle::LIFECYCLES;
                     return unless %lifecycle;
 
                     my $sql;

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


More information about the rt-commit mailing list