Not receiving Pending reminders

Moderator: crythias

Locked
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Not receiving Pending reminders

Post by aph »

In my system agents do not receive e-mail notification when the pending time has reached. How do I enable this feature. Below are the contents of my
/opt/otrs/var/cron/pending_jobs file

Code: Select all

# check every 120 min the pending jobs
45 */2 * * *    $HOME/bin/otrs.PendingJobs.pl >> /dev/null
So theoretically the reminder mails should be sent. Furthermore, I do not get any errors in the logs regarding failed mail sending etc.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

Any ideas on this one?
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Not receiving Pending reminders

Post by reneeb »

Try to replace $HOME with /opt/otrs/ (or whatever the path is to your OTRS installation).

Run the command on the commandline (as the user that runs the cron). Maybe you get an error then...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

On running the script I get the following error

Code: Select all

No pending auto StateIDs found - skipping script!
We have a state "on the back burner"of type 'pending reminder'. Agents set the state and a Pending Date (for pending* states):
equal to the date, on which they would like to be reminded about the ticket. Agents here would like to get an e-mail notification, when the reminder has reached. How can I configure this?
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

As far as I understand and as mentioned in this thread viewtopic.php?t=11594#p45306 auto state IDs have something to do with 'pending auto' types of states and not with 'pending reminder' type of tickets. I have in fact set the states pending auto close + and pending auto close - to invalid since we don't use them. I had success once on when ran the script on the test system and I get the message:

Code: Select all

ERROR: No Ticket::StateAfterPending found for 'on the back burner' in Kernel/Config.pm!
 Send reminder notification (TicketID=74)
Unfortunately, when I re-ran the script on the test system, I get the message

Code: Select all

No pending auto StateIDs found - skipping script!
I can't quite figure out where the problem lies. I can see 4 tickets under "reminder tickets" on dashboard, yet no notifications are sent (I had changed reminder times of the tickets to a few minutes later from current time)
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Not receiving Pending reminders

Post by EXG133 »

PendingJobs.pl first part is specifically for 'pending auto' :

my @PendingAutoStateIDs = $CommonObject{StateObject}->StateGetStatesByType(
Type => 'PendingAuto',
Result => 'ID',
);

And second part is for reminders:

# get pending states
my @PendingReminderStateIDs = $CommonObject{StateObject}->StateGetStatesByType(
Type => 'PendingReminder',
Result => 'ID',
);

Does the 'pending auto' part work?


EDIT: check in the sysconfig in Core::Ticket if Ticket::PendingAutoStateType and Ticket::PendingReminderStateType have the correct values.
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

I cannot test whether Pending Auto type works, since we have no states of type "pending auto".

In Core::Ticket the Ticket::PendingReminderStateType is set to 'pending reminder' which is correct as the states in question are of type 'pending reminder'

So I feel the notification mechanism should work irrespective thereof whether the 'pending auto' part of the script is executed or not.

I can't quite figure out wherein the error lies.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Not receiving Pending reminders

Post by EXG133 »

Pff I must have been sleeping.

"No pending auto StateIDs found - skipping script!" is from this part:

if ( !@PendingAutoStateIDs ) {
print STDOUT " No pending auto StateIDs found - skipping script!\n";
exit 0;
}

So I think it's indeed closing the script. Can you try adding a state with type 'pending auto' (as invalid so it doesn't show for users) ?
On your test system 'on backburner' is a pending auto state but the sysconfig doesn't have the value to which it should be changed so it's a different error.
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

EXG133 wrote:Pff I must have been sleeping.

"No pending auto StateIDs found - skipping script!" is from this part:

if ( !@PendingAutoStateIDs ) {
print STDOUT " No pending auto StateIDs found - skipping script!\n";
exit 0;
}

So I think it's indeed closing the script. Can you try adding a state with type 'pending auto' (as invalid so it doesn't show for users) ?
On your test system 'on backburner' is a pending auto state but the sysconfig doesn't have the value to which it should be changed so it's a different error.
Well when I said we don't have any 'pending auto' states, I meant none that are 'active'. The states 'pending auto close+' and 'pending auto close-' are in the system and set to 'invalid' in the admin area and thus not visible to users.

Being inactive the states pending auto close+' and 'pending auto close-' cannot be added to Ticket::StateAfterPending in Ticket -> Core::Ticket

But that's beside the point, since the state 'on back burner' is of type 'pending reminder' and not 'pending auto' as you assumed.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

I even tried adding the state 'on back burner' to Ticket::StateAfterPending in Ticket -> Core::Ticket as key and state 'open' as content. Yet no avail, because I think the setting is relevant only for the 'pending auto' type of states as keys.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Not receiving Pending reminders

Post by EXG133 »

I quickly tried this on my sandbox: I have a single 'pending auto' state called Resolved. I ran "sudo /opt/otrs/bin/otrs.PendingJobs.pl" and got this as output:

Code: Select all

 Send reminder notification (TicketID=741)
I changed Resolved to a 'pending reminder' and ran sudo /opt/otrs/bin/otrs.PendingJobs.pl again :

Code: Select all

No pending auto StateIDs found - skipping script!
I changed Resolved back to 'pending auto' but set it to INVALID and ran "sudo /opt/otrs/bin/otrs.PendingJobs.pl" again :

Code: Select all

No pending auto StateIDs found - skipping script!
So I think you need at least one state 'pending auto' that is valid. Just for fun I tried commenting out the check but ofcourse you run into issues later in the script because you're doing an empty search:

Code: Select all

 Message: The given param 'StateIDs' is invalid or an empty array reference!

 Traceback (25094):
   Module: Kernel::System::Ticket::TicketSearch::TicketSearch Line: 355
   Module: /opt/otrs/bin/otrs.PendingJobs.pl Line: 69
I might be overlooking something but this looks like a bug?
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

Thanks for the effort EXG133, really appreciate it.

I just wonder, why the standard functionality of OTRS doesn't want to work.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Not receiving Pending reminders

Post by EXG133 »

I think this might work:

1) enable a 'pending auto' state eg 'pending autoclose+'
2) use ACL to hide this from the dropdowns like this:

Match Settings:
Properties
Frontend
Action:
AgentTicketZoom,AgentTicketPhone,AgentTicketEmail,AgentTicketPriority (+ofcourse anywhere else where you use State)

Change settings:
PossibleNot
Ticket
State:'pending autoclose+'

I'm doing a server cleanup at work, these are my breaks from boredom :lol:
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: Not receiving Pending reminders

Post by aph »

EXG133 wrote:I think this might work:

1) enable a 'pending auto' state eg 'pending autoclose+'
2) use ACL to hide this from the dropdowns like this:

Match Settings:
Properties
Frontend
Action:
AgentTicketZoom,AgentTicketPhone,AgentTicketEmail,AgentTicketPriority (+ofcourse anywhere else where you use State)

Change settings:
PossibleNot
Ticket
State:'pending autoclose+'

That sounds like a good idea. Although, I'd rather use a regex than typing each action separately.

Coming back to the original problem: I have tickets whose reminder date/time was reached over 2.5 hours ago, yet I don't see the message "Sent agent 'PendingReminder' notification to xxxx" in the system log. According to the pending_jobs file in /opt/otrs/var/cron/ directory, the system should check for pending jobs every 120 minutes. So apparently the cronjob is not being executed or am I overlooking something?
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
Locked