#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
package RT::Condition::OwnerChange;
use base 'RT::Condition';
use strict;
+use warnings;
=head2 IsApplicable
sub IsApplicable {
my $self = shift;
- if ( ( $self->TransactionObj->Field || '' ) eq 'Owner' ) {
- return(1);
- }
- else {
- return(undef);
- }
+ return unless ( $self->TransactionObj->Field || '' ) eq 'Owner';
+
+ # For tickets, there is both a Set txn (for the column) and a
+ # SetWatcher txn (for the group); we fire on the former for
+ # historical consistency. Non-ticket objects will not have a
+ # denormalized Owner column, and thus need fire on the SetWatcher.
+ return if $self->TransactionObj->Type eq "SetWatcher"
+ and $self->TransactionObj->ObjectType eq "RT::Ticket";
+
+ return(1);
}
-eval "require RT::Condition::OwnerChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Vendor.pm});
-eval "require RT::Condition::OwnerChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Local.pm});
+RT::Base->_ImportOverlays();
1;