Hello, I created the script in RT5 if the ticket is in new status more than 2 hours, it will trigger the email, however it is working only when there is any manual updates in tickets such as user comments, any updates in ticket , I need to trigger this mail automatically at regular interval…can you please help me how to work on this part??. Below is the custom condition script
Check if the ticket is in ‘new’ status and has been in this status for more than 2 hours
my $status = $self->TicketObj->Status;
my $created = $self->TicketObj->CreatedObj->Unix; # Time the ticket was created
my $now = time(); # Current time
Calculate time difference in seconds
my $time_difference = $now - $created;
7200 seconds is equivalent to 2 hours
if ($status eq ‘new’ && $time_difference > 7200) {
return 1; # Return true to trigger the notification
}
return undef; # Otherwise, do not trigger the notification