[Rt-commit] [rtir] 02/02: Only change the constituency of child tickets if they started off with the same constituency

Jesse Vincent jesse at bestpractical.com
Sun Mar 29 03:18:28 EDT 2015


This is an automated email from the git hooks/post-receive script.

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit 9e9afd6c566b12201bc70b03a6504de9cb7c7bf8
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Mar 29 00:18:03 2015 -0700

    Only change the constituency of child tickets if they started off with the same constituency
---
 lib/RT/Action/RTIR_ChangeChildConstituencies.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/RT/Action/RTIR_ChangeChildConstituencies.pm b/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
index 426f150..d9bcd68 100644
--- a/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
+++ b/lib/RT/Action/RTIR_ChangeChildConstituencies.pm
@@ -68,13 +68,15 @@ sub Prepare {
 
     return 0 unless (RT::IR->ConstituencyFor($q2) ne RT::IR->ConstituencyFor($q1));
 
+    $self->{'old_constituency'} = RT::IR->ConstituencyFor($q1);
     $self->{'new_constituency'} = RT::IR->ConstituencyFor($q2);
     return 1;
 }
 
 =head2 Commit
 
-Change the constituency of children.
+Change the constituency of children, but only if they were started
+off in the same constituency as the incident
 
 =cut
 
@@ -91,6 +93,7 @@ sub Commit {
     while ( my $ticket = $kids->Next) {
         my $kid_constituency = RT::IR->ConstituencyFor($ticket);
         next if ($kid_constituency eq $new_constituency);
+        next if ($kid_constituency ne $old_constituency);
         # if the constituency of the other ticket isn't the same as the new 
         # constituency
         my $kid_queue = $ticket->QueueObj->Name;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list