Commit e9b63eb1 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

new option - IgnoreOnStatuses

Allows you to ignore deadline(s) when ticket has certain status(es)
parent c929225f
0.06 Not released
* IgnoreOnStatuses agreement modifier
0.05_02 Wed Jun 27 15:44:36 PDT 2012
* Make sure timezone change is seen by system functions
......
......@@ -22,7 +22,7 @@
},
{ Name => '[SLA] Require Due set', # loc
Description => 'Detect a situation when we should set Due date' , # loc
ApplicableTransTypes => 'Create,CustomField,Correspond',
ApplicableTransTypes => 'Create,CustomField,Correspond,Set,Status',
ExecModule => 'SLA_RequireDueSet',
},
);
......
our @Final = (
sub {
my $condition = RT::ScripCondition->new( RT->SystemUser );
$condition->LoadByCols( ExecModule => 'SLA_RequireDueSet' );
unless ( $condition->id ) {
$RT::Logger->error("Couldn't find condition based on SLA_RequireDueSet module. New installation?");
return 0;
}
my ($status, $msg) = $condition->SetApplicableTransTypes('Create,CustomField,Correspond,Set,Status');
unless ($status) {
$RT::Logger->error("Couldn't set ApplicableTransTypes for condition: $msg");
}
return 1;
},
);
\ No newline at end of file
......@@ -25,6 +25,10 @@ sub IsApplicable {
return 1 if $self->TicketObj->FirstCustomFieldValue('SLA');
return 0;
}
elsif ( $type eq 'Status' || ($type eq 'Set' && $self->TransactionObj->Field eq 'Status') ) {
return 1 if $self->TicketObj->FirstCustomFieldValue('SLA');
return 0;
}
return 1 if $self->IsCustomFieldChange('SLA');
return 0;
}
......
......@@ -242,7 +242,9 @@ In the above example Due is set to one hour after creation, reply
of a non-requestor moves Due date two hours forward, requestors'
replies move Due date to one hour and resolve deadine is 24 hours.
=head2 OutOfHours (struct, no default)
=head2 Modifying Agreements
=head3 OutOfHours (struct, no default)
Out of hours modifier. Adds more real or business minutes to resolve
and/or reply options if event happens out of business hours, read also
......@@ -266,6 +268,20 @@ hours, otherwise only one.
Supporters have two additional hours in the morning to deal with bunch
of requests that came into the system during the last night.
=head3 IgnoreOnStatuses (array, no default)
Allows you to ignore a deadline when ticket has certain status. Example:
'level x' => {
KeepInLoop => { BusinessMinutes => 60, IgnoreOnStatuses => ['stalled'] },
},
In above example KeepInLoop deadline is ignored if ticket is stalled.
B<NOTE> that if you just open ticket without a reply then Due date will be
calculated from old action and ticket will probably be overdue. In most
cases it shouldn't be a problem.
=head2 Configuring business hours
In the config you can set one or more work schedules. Use the following
......@@ -377,6 +393,11 @@ sub Agreement {
return undef;
}
if ( $args{'Ticket'} && $res{'IgnoreOnStatuses'} ) {
my $status = $args{'Ticket'}->Status;
return undef if grep $_ eq $status, @{$res{'IgnoreOnStatuses'}};
}
$res{'OutOfHours'} = $meta->{'OutOfHours'}{ $args{'Type'} };
$args{'Queue'} ||= $args{'Ticket'}->QueueObj if $args{'Ticket'};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment