[Rt-commit] rt branch, 4.4/queue-create-sla, created. rt-4.4.0-120-g21a1ea1

Shawn Moore shawn at bestpractical.com
Fri May 13 15:58:57 EDT 2016


The branch, 4.4/queue-create-sla has been created
        at  21a1ea186b47dc9f2f46697372c675f9a9f0b0bc (commit)

- Log -----------------------------------------------------------------
commit f9bb838d6549dfae6780e53e97cecbb02ec98548
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed May 11 20:18:57 2016 +0000

    Failing tests for setting SLA during RT::Queue->Create

diff --git a/t/api/queue.t b/t/api/queue.t
index 71efb4d..e3c4fd2 100644
--- a/t/api/queue.t
+++ b/t/api/queue.t
@@ -2,7 +2,21 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test nodata => 1, tests => undef;
+use RT::Test nodata => 1, tests => undef, config => <<'CONFIG';
+Set( %ServiceAgreements, (
+    Default => 'standard',
+    Levels => {
+        'standard' => {
+            Starts => { RealMinutes => 0 },
+            Resolve => { RealMinutes => 8*60 },
+        },
+        'urgent' => {
+            Starts => { RealMinutes => 0 },
+            Resolve => { RealMinutes => 2*60 },
+        },
+    },
+));
+CONFIG
 
 
 {
@@ -86,4 +100,19 @@ ok ($group->Id, "Found the AdminCc object for this Queue");
 
 }
 
+{
+    my $NoSLA = RT::Queue->new(RT->SystemUser);
+    my ($id, $msg) = $NoSLA->Create(Name => "NoSLA");
+    ok($id, "created queue NoSLA");
+    is($NoSLA->SLA, undef, 'No SLA for NoSLA');
+
+    my $WithSLA = RT::Queue->new(RT->SystemUser);
+    ($id, $msg) = $WithSLA->Create(Name => "WithSLA", SLA => 'urgent');
+    ok($id, "created queue WithSLA");
+    is($WithSLA->SLA, 'urgent', 'SLA is set');
+
+    $WithSLA->SetSLA('standard');
+    is($WithSLA->SLA, 'standard', 'SLA is updated');
+}
+
 done_testing;

commit 21a1ea186b47dc9f2f46697372c675f9a9f0b0bc
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed May 11 20:14:58 2016 +0000

    Allow setting SLA in RT::Queue->Create
    
    Fixes: I#31823

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index b3940b3..2a80a6c 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -159,6 +159,7 @@ sub Create {
         Sign              => undef,
         SignAuto          => undef,
         Encrypt           => undef,
+        SLA               => undef,
         _RecordTransaction => 1,
         @_
     );
@@ -198,7 +199,7 @@ sub Create {
     }
     $RT::Handle->Commit;
 
-    for my $attr (qw/Sign SignAuto Encrypt/) {
+    for my $attr (qw/Sign SignAuto Encrypt SLA/) {
         next unless defined $args{$attr};
         my $set = "Set" . $attr;
         my ($status, $msg) = $self->$set( $args{$attr} );

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


More information about the rt-commit mailing list