[Rt-commit] rt branch, 4.4/sla, repushed
? sunnavy
sunnavy at bestpractical.com
Thu Aug 13 12:13:21 EDT 2015
The branch 4.4/sla was deleted and repushed:
was 3c183d37ad686ddc377bcff41c2511a956fea9a0
now 5d441ebff4ff685ffc4c17e8e11fa2d8518a5cb4
1: 7e14558 = 1: df41846 import sla extension
2: ba8b312 ! 2: 821d3ed use SLA column in Tickets table instead of a custom field
@@ -171,12 +171,12 @@
+ },
+ { Name => '[SLA] Require Starts set', # loc
+ Description => 'Detect a situation when we should set Starts date' , # loc
-+ ApplicableTransTypes => 'Create,CustomField',
++ ApplicableTransTypes => 'Create,Set',
+ ExecModule => 'SLA_RequireStartsSet',
+ },
+ { Name => '[SLA] Require Due set', # loc
+ Description => 'Detect a situation when we should set Due date' , # loc
-+ ApplicableTransTypes => 'Create,CustomField,Correspond,Set,Status',
++ ApplicableTransTypes => 'Create,Correspond,Set,Status',
+ ExecModule => 'SLA_RequireDueSet',
+ },
+);
3: 231fe16 = 3: a075107 allow to disable SLA for some queues
4: 404ba02 ! 4: 633e438 set default SLA in ticket create stage directly
@@ -7,6 +7,17 @@
diff --git a/etc/initialdata b/etc/initialdata
--- a/etc/initialdata
+++ b/etc/initialdata
+@@
+ { Name => 'Send Forward', # loc
+ Description => 'Send forwarded message', # loc
+ ExecModule => 'SendForward', },
+- { Name => '[SLA] Set default service level', # loc
+- Description => 'Set service level according to the config' , # loc
+- ExecModule => 'SLA_SetDefault',
+- },
+ { Name => '[SLA] Set starts date', # loc
+ Description => 'Set the starts date according to an agreement' , # loc
+ ExecModule => 'SLA_SetStarts',
@@
ApplicableTransTypes => 'Status,Set',
ExecModule => 'ReopenTicket',
@@ -31,6 +42,49 @@
ScripCondition => '[SLA] Require starts set',
ScripAction => '[SLA] Set starts date',
+diff --git a/etc/upgrade/4.3.8/content b/etc/upgrade/4.3.8/content
+--- a/etc/upgrade/4.3.8/content
++++ b/etc/upgrade/4.3.8/content
+@@
+ use warnings;
+
+ our @ScripConditions = (
+- { Name => '[SLA] Require default', # loc
+- Description => 'Detect a situation when we should set default service level' , # loc
+- ApplicableTransTypes => 'Create',
+- ExecModule => 'SLA_RequireDefault',
+- },
+ { Name => '[SLA] Require Starts set', # loc
+ Description => 'Detect a situation when we should set Starts date' , # loc
+ ApplicableTransTypes => 'Create,Set',
+@@
+ );
+
+ our @ScripActions = (
+- { Name => '[SLA] Set default service level', # loc
+- Description => 'Set service level according to the config' , # loc
+- ExecModule => 'SLA_SetDefault',
+- },
+ { Name => '[SLA] Set starts date', # loc
+ Description => 'Set the starts date according to an agreement' , # loc
+ ExecModule => 'SLA_SetStarts',
+@@
+ );
+
+ our @Scrips = (
+- { Description => "[SLA] Set default service level if needed",
+- ScripCondition => '[SLA] Require Default',
+- ScripAction => '[SLA] Set default service level',
+- Template => 'Blank' },
+ { Description => "[SLA] Set starts date if needed",
+ ScripCondition => '[SLA] Require starts set',
+ ScripAction => '[SLA] Set starts date',
+@@
+ ScripAction => '[SLA] Set due date',
+ Template => 'Blank' },
+ );
+-
+
diff --git a/lib/RT/Action/SLA_SetDefault.pm b/lib/RT/Action/SLA_SetDefault.pm
deleted file mode 100644
--- a/lib/RT/Action/SLA_SetDefault.pm
5: 87aaf48 = 5: 61faa65 update doc/config and move it to RT_Config.pm
6: 4439388 ! 6: 52f5f62 upgrade-sla script to migrate old data used in SLA extension
@@ -129,39 +129,48 @@
+ }
+}
+
-+my $scrip = RT::Scrip->new(RT->SystemUser);
-+$scrip->LoadByCols( Description => '[SLA] Set default service level if needed' );
-+if ( $scrip->id ) {
-+ my ($ret, $msg) = $scrip->RT::Record::Delete();
-+ if ( $ret ) {
-+ RT->Logger->info(qq{Deleted scrip "[SLA] Set default service level if needed"});
-+ }
-+ else {
-+ RT->Logger->error(qq{Failed to delete scrip "[SLA] Set default service level if needed": $msg});
++my @old_scrips = ( '[SLA] Set default service level if needed', '[SLA] Set starts date if needed', '[SLA] Set due date if needed' );
++for my $item ( @old_scrips ) {
++ my $scrip = RT::Scrip->new(RT->SystemUser);
++ $scrip->LoadByCols( Description => $item );
++ if ( $scrip->id ) {
++ my ($ret, $msg) = $scrip->RT::Record::Delete();
++ if ( $ret ) {
++ RT->Logger->info(qq{Deleted scrip "$item"});
++ }
++ else {
++ RT->Logger->error(qq{Failed to delete scrip "$item": $msg});
++ }
+ }
+}
+
-+my $condition = RT::ScripCondition->new(RT->SystemUser);
-+$condition->Load('[SLA] Require default');
-+if ( $condition->id ) {
-+ my ($ret, $msg) = $condition->RT::Record::Delete();
-+ if ( $ret ) {
-+ RT->Logger->info(qq{Deleted condition "[SLA] Require default"});
-+ }
-+ else {
-+ RT->Logger->error(qq{Failed to delete condition "[SLA] Require default": $msg});
++my @old_conditions = ( '[SLA] Require default', '[SLA] Require Starts set', '[SLA] Require Due set' );
++for my $item ( @old_conditions ) {
++ my $condition = RT::ScripCondition->new(RT->SystemUser);
++ $condition->Load($item);
++ if ( $condition->id ) {
++ my ($ret, $msg) = $condition->RT::Record::Delete();
++ if ( $ret ) {
++ RT->Logger->info(qq{Deleted condition "$item"});
++ }
++ else {
++ RT->Logger->error(qq{Failed to delete condition "$item": $msg});
++ }
+ }
+}
+
-+my $action = RT::ScripAction->new(RT->SystemUser);
-+$action->Load('[SLA] Set default service level');
-+if ( $action->id ) {
-+ my ($ret, $msg) = $action->RT::Record::Delete();
-+ if ( $ret ) {
-+ RT->Logger->info(qq{Failed to delete action "[SLA] Set default service level"});
-+ }
-+ else {
-+ RT->Logger->error(qq{Failed to delete action "[SLA] Set default service level": $msg});
++my @old_actions = ('[SLA] Set default service level', '[SLA] Set starts date', '[SLA] Set due date' );
++for my $item ( @old_actions ) {
++ my $action = RT::ScripAction->new(RT->SystemUser);
++ $action->Load($item);
++ if ( $action->id ) {
++ my ($ret, $msg) = $action->RT::Record::Delete();
++ if ( $ret ) {
++ RT->Logger->info(qq{Failed to delete action "$item"});
++ }
++ else {
++ RT->Logger->error(qq{Failed to delete action "$item": $msg});
++ }
+ }
+}
7: 446026e = 7: f255b26 upgrading note for core SLA
8: 1ea15af ! 8: b645c2b warn if we still have SLA extension enabled
@@ -13,7 +13,7 @@
=cut
+our %CORED_PLUGINS = (
-+ 'RT::Extension::SLA' => 4.4,
++ 'RT::Extension::SLA' => '4.4',
+);
+
sub InitPlugins {
--: ------- > 9: b109c8a better name of SLA conditions/actions/scrips
9: 3c183d3 ! 10: 5d441eb SLA tests
@@ -966,9 +966,11 @@
+ Default => '2',
+ Levels => {
+ '2' => {
++ StartImmediately => 1,
+ Response => { RealMinutes => 60 * 2 },
+ },
+ '4' => {
++ StartImmediately => 1,
+ Response => { RealMinutes => 60 * 4 },
+ },
+ },
More information about the rt-commit
mailing list