[Rt-commit] [rtir] 32/33: Fix queues to be named Countermeasures

Shawn Moore shawn at bestpractical.com
Fri May 13 20:21:52 EDT 2016


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

shawn pushed a commit to branch 3.4/countermeasures
in repository rtir.

commit 1565e04fdece306128c21e310013028d85d590c8
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Sat May 14 00:19:43 2016 +0000

    Fix queues to be named Countermeasures
---
 etc/upgrade/3.3.0/content | 22 +++++++++++++++++++++-
 etc/upgrade/3.3.4/content |  2 +-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/etc/upgrade/3.3.0/content b/etc/upgrade/3.3.0/content
index 02eb690..9d8321d 100644
--- a/etc/upgrade/3.3.0/content
+++ b/etc/upgrade/3.3.0/content
@@ -50,7 +50,7 @@ our @Final = (
               for ( 'RTIR_RequireConstituencyChange', 'RTIR_RequireConstituencyGroupChange' );
         }
 
-        # rename blocks to countermeasures
+        # fix lifecycle from blocks to countermeasures
         {
             my $queues = RT::Queues->new(RT->SystemUser);
             $queues->Limit(FIELD => 'Lifecycle', VALUE => 'blocks');
@@ -59,6 +59,26 @@ our @Final = (
             }
         }
 
+        # fix queue name from Blocks to Countermeasures
+        {
+            my $queues = RT::Queues->new(RT->SystemUser);
+            $queues->Limit(
+                  FIELD    => 'Name',
+                  OPERATOR => 'STARTSWITH',
+                  VALUE    => 'Blocks',
+            );
+
+            while (my $queue = $queues->Next) {
+                next unless $queue->Name eq 'Blocks'
+                         || $queue->Name =~ /^Blocks - /;
+
+                my $new = $queue->Name;
+                $new =~ s/^Blocks/Countermeasures/;
+
+                $queue->SetName($new);
+            }
+        }
+
         # update values of rtir constituency
         my @constituencies;
         {
diff --git a/etc/upgrade/3.3.4/content b/etc/upgrade/3.3.4/content
index 2009a08..d303765 100644
--- a/etc/upgrade/3.3.4/content
+++ b/etc/upgrade/3.3.4/content
@@ -18,7 +18,7 @@ our @Initial = (
             elsif ($name =~ /^Investigations - /) {
                 $lifecycle = RT::IR->lifecycle_investigation;
             }
-            elsif ($name =~ /^(Blocks|Countermeasures) - /) {
+            elsif ($name =~ /^Countermeasures - /) {
                 $lifecycle = RT::IR->lifecycle_countermeasure;
             }
             else {

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


More information about the rt-commit mailing list