Hello,

We switched to OSticket from Spiceworks about 4-5 months ago... For the most part it works great but we are having an issue receiving notifications on ticket responses sometimes...

We are a small support shop here (with 2 agents), and we depend on the ticket alerts to be notified when we need to respond to a ticket... We are not looking at the agent panel all day, so sometimes these tickets go un-answered for long periods of time when we do not get these notifications..

What is frustrating is that on SOME tickets the assigned agent is being notified, while on others they are not being notified, so it seems that the problem is intermittent...

We can alleviate this problem somewhat by putting ourselves on the tickets as collaborators (as well as being the assigned agent), and then we will get an end-user collaboration email when a ticket gets a response... This usually works, however it seems un-necessary and sometimes (on tickets that are working as expected) we get double emailed (once as a collaborator, and once as the agent)...

I will include here a screenshot of our OSTicket info page... We are running this on Windows using PHP v8 and MySQL 5.5... We are on the (almost) latest version of 1.16.1, however we were having this same issue back on version 1.15 (we were hoping that 1.16 would fix it, but it did not)...

I don't believe that the email is being held up at the SMTP level because I have looked at the logs on the SMTP server and I can see that there are no emails that are not being delivered... I have also looked at the OSTicket system logs (with log level turned to Debug) and I have not noticed anything there either...

I would be willing to share any other configuration item(s) you want me to post here... Can someone please help us with this?? I like the OSTicket system but notifications are a must have, and right now they are not working as expected...

... I will post the screenshot of the info page here
..

So my suggestion to you might sound a little bizarre, but its what we have been using where I work for years now.

We created an Agent account (as the department manager) and only send the alerts to the department manager. This account is actually a mailing list on our mailserver and sends the alerts to my IT department.

As a side note most of the time there I have seen people describe what you are describing is when someone is assigned to the ticket at creation... it suppresses the ticket open email in that case.

  • TPK replied to this.

    ntozier
    Hello, ntozier, and thank you for the reply...

    So we were also thinking along those same lines, however with our 2-man support group here, we usually take care of tickets separately, depending on the technical range of the issue (I am more of a technical back-end resource, the other is more of a front-end operations resource)... Some are assigned to me, and some are assigned to the other agent, etc... We really want to try to keep our tickets separate (in most cases), so having us both be notified on all ticket responses, regardless of assignee is something we would like to avoid (if possible)..

    There are times when we want to both be involved with a ticket (probably 10% of the time)... In Spiceworks we were able to assign multiple agents to the same ticket, however with OSTicket it seems only one agent can be assigned at a time, so we have been using the collaborator work-around in these cases, which while not great, does work well enough... It is in these cases where a department-wide distribution group or team might make the most sense...

    We do both get notified on new ticket submissions by end-users, because we are configured for the same support department, which works out fine (that has always worked, every time). However in most cases, the tickets get assigned to one agent or the other (sometimes we will assign the ticket to ourselves, and sometimes we will assign it to the other agent, depending on the issue)...

    I don't think the issue here has to do with opening new tickets and missing the ticket opening or creation email alert... Almost all tickets are end-user submitted here (either through the web portal, or via email)... The issue is that sometimes we are not notified when replies are made to the tickets by the end-users (which can happen via email or via web portal), if we are the assignee on the ticket... The assignee sometimes (I would say half the time) does not get an email alert at all...

    We keep trying to figure out what makes these tickets different (why we are notified some times and not others), but haven't been able to come up with any sort of consistent explanation...

    Also, I did not mention this before...

    The issue seems to affect mostly email responses, and not portal responses...

    Almost all of our end-users use email to send replies back to the helpdesk, and not the portal... When they use email, the help desk always gets the response appended to the ticket, so that seems to parse properly... But then the alerts do not get sent to the assigned agent about half of the time (and sometimes the agent does get the response)..

    I do not believe that agents must be CCd on ticket responses via email to get an alert (that might be true for collaborators, but not assigned agents, as far as I know)...

    Now we are using google apps (gmail) as our email host, and we have that configured to log into the helpdesk's gmail account and retrieve the email from there (imap.gmail.com).. We also have the "Delete emails" checked, so these essentially get popped out of the account when retrieved by the system... That all seems to work...

    But I wonder if the problem is with the gmail headers, or some other header parsing issue (??)

    I just wanted to bring that up here, in case someone has some experience with gmail as the possible culprit here when being used as the source email box for the retrieval of helpdesk ticket responses (I am trying to nail down all the variables)...

      TPK

      Check the Department settings to ensure the alerts are enabled there and are configured to send to the appropriate members.

      This is the method that triggers on User Message:

      As you can see in that method there are a few ways alerts won’t be sent to Agents but the we can start with the first two:

      1. If the $alerts variable is false. This is always true for User email messages so this is not the case here.
      2. If the $autorespond variable is false. This is mostly dependent on if the incoming email is a bounce or auto reply. This could be what’s happening with you. (see below)

      Bounce/AutoReply

      We use certain email headers to determine if an email is an AutoReply. These headers are defined below. If the incoming email has any of those headers it will prevent alerts from sending to the Users/Agents. I think this is what’s happening in your case as you said it’s email replies from users that aren’t sending the alerts to agents.

      Cheers.

      Hello Kevin,

      Thank you kindly for your reply, and pointing out some specifics...

      So using the "View email headers" from a reply from a ticket post that failed to send an alert, I analyzed the headers against the array of $auto_headers out of the isAutoReply function, and I couldn't find anything that matched between the headers from the email and what was in the $auto_headers array...

      I also compared the headers to the $bounce_headers from isBounce function as well and found nothing...

      So I don't think this is the issue here, and something else must be going on...

      I could post the headers here, but I am afraid of the PID that might be in there... I would be happy to PM it to you, if you would allow me to (if you think it would help)...

        TPK

        You can edit the headers to remove any host names, any ips, any emails, and any other sensitive info. You should be fine afterwards.

        Cheers.

        • TPK replied to this.

          KevinTheJedi

          Thanks so much for your help so far...

          So what I did here was I created a test ticket in our system, added a bunch of collaborators (from my various emails), and then tested replies back to the helpdesk...

          One out of the three (from my home email, hosted at zoho mail) seemed to reliably generate replies back to the assigned agent... The other two (yahoo and gmail) did not...

          I grabbed the headers from the portal for each of these sample responses and created this archive with the three headers, and a readme file.. I will attach that here as a zip archive of text files... I tried to obfuscate the email addresses so they would remain consistent, while hiding our non-yahoo/gmail domain name(s), and my own last name (I am not all that expert at reading email headers, so hopefully this is enough obfuscation without ruining the headers for analysis)...

          some notes:

          1) All reply emails did successfully append to the ticket, which can be seen in the portal.
          2) Only the "home" email (hosted at zoho mail) generated an alert back to the assigned agent, AND ALSO received back a confirmation ("Your reply to support request #06172 has been noted") email..
          3) The yahoo email was the original creator of the ticket. The ticket was created by the yahoo user sending an email to the helpdesk system. The agents in the support department DID receive a notification that a ticket was created. Then the agent (myself) logged into the agent panel (SCP) and assigned the ticket to myself..
          4) The yahoo mail user, when replying to the ticket via email, did NOT generate an alert back to the assigned agent, and also did NOT receive back a confirmation email.
          5) The yahoo mail user, when replying to the ticket via the portal, DID generate an alert back to the assigned agent and also DID receive back a confirmation email.
          6) The gmail user, when replying to the ticket via email, did NOT generate an alert back to the assigned agent, and also did NOT receive back a confirmation email.

          Hopefully that all makes sense...

          DO you see anything in the headers that might indicate why agent alerts would not have been sent out on email responses??

          I will attach the file here:
          (file removed by admin)

          @TPK

          Thank you, I have removed the link after downloading. 👍

          I will take a look to see.

          Cheers.

          • TPK replied to this.

            KevinTheJedi

            Thank you so much for taking the time to look at that...

            FYI I do have access to the helpdesk system back-end and the database, and IIS and all of the files, etc.. (I was the one that installed it here and converted the data from spiceworks, etc..).. This is all running within IIS on Windows and MySQL on a dedicated server VM...

            If the headers don't turn up anything, I would be more than happy to install some logging code, or even have you remote in here (if you are willing to do that) if you would like to poke around the system and help troubleshoot this...

            Whatever I can do to help support these efforts to get agent alerts working... Please let me know ...

            ... Thanks again

              TPK

              Go to this line in your code. Before the if (!($alerts && $autorespond)) line, create a new line and insert the below code (try to match the spacing as best you can) and save changes. Next create a file in your osTicket root directory called var_dump.txt with enough permission for PHP to read/write to it (0666 should be fine). After that repeat your test with Testing123 in the Subject lines. Once all of them are processed you can open the var_dump.txt file and should see the results. You can add the file here afterwards (after obfuscating the email addresses).

                     if (str_contains(isset($vars['subject']) ? $vars['subject'] : $ticket->getSubject(), 'Testing123')) {
                         ob_flush();
                         ob_start();
                         var_dump('Subject: ', isset($vars['subject']) ? $vars['subject'] : $ticket->getSubject());
                         var_dump('Poster: ', $vars['email']);
                         var_dump('Alerts: ', $alerts);
                         var_dump('Autorespond: ', $autorespond);
                         file_put_contents("/path/to/osticket/var_dump.txt", ob_get_flush(), FILE_APPEND);
                     }

              P.S.
              You will need to replace /path/to/osticket/ with the actual full path to your osTicket directory where you put the var_dump.txt file.

              This will essentially determine if they are actually getting past the if statement or not.

              Cheers.

              • TPK replied to this.

                KevinTheJedi

                Okay, will do... But I have a couple of questions, based mostly on my ignorance on how the system fundamentally works, and what is allowed within PHP. Please forgive these noob-ish questions, I just want to make sure that I get everything exactly right...

                1) Do I replace the entire subject on replies with "Testing123", or should I put "Testing123" after or before the existing subject (which should be something like "Re: Test ticket from yahoo [#06172]") ... I am not sure exactly how OSTicket connects email responses back to the ticket, but if it uses the subject line with the ticket number then perhaps I need to keep that in there somewhere (??)

                2) Since this is a windows system, the path to OSTicket files is going to be "C:\inetpub\wwwroot\Helpdesk".. I know that most C-type languages use backslash as the escape character, so should I change that to "C:\inetpub\wwwroot\Helpdesk" or "C:/inetpub/wwwroot/Helpdesk" or leave it as is??

                .... Edit ... double back-slashes didn't survive the forum post formatting, so what I was wondering is if I need to use double-backslash instead of single back-slash for the path name ...

                @TPK

                1. You will create a new ticket for the new test. Put Testing123 anywhere in the initial email's subject line. I think when you reply all (as collabs) it doesn't let you change the subject but if it does just make sure Testing123 is somewhere in the subject line.
                2. Sorry, forgot you're on windows. Yes, you can do backslash. I believe normal 1 backslash should work. Of course it's been forever since I touched windows so it might need double backslashes.

                Cheers.

                KevinTheJedi

                So here is what happens...

                I attempted to put the code in there, and I would never get anything in the var_dump.txt file and I would no longer get agent alerts from the ticket responses, when appending "Testing123" to the subject...

                So its possible that I might not have permissions properly set up for the var_dump.txt file, or I might not have formulated the filename properly within the put_contents function, however I don't think that is where the problem lies...

                I think there is something wrong with the code, and when it attempts to evaluate what is in the "IF" statement there, because no matter what I do, I cannot get the agent to receive an alert as long as the code is in there, even when I do not put the Testing123 into the subject line (which should ostensibly mean that the code within the if statement should not fire, yes??)

                I have done all this testing with my home account (the one that seemingly works)... When I email the ticket from that account (without any modification to the subject line), and the extra code present, I get a message confirmation email back (saying that my reply has been noted), however the agent does not get an alert anymore...

                Whenever I remove the code, I get both a message confirmation back, and the agent does get an alert...

                I will include a screenshot here of what the code looks like out of class.ticket.php

                So anyhow, regardless of how I formulate the string for the var_dump file, that code should never be executed if there is no "Testing123" in the subject line anyhow, yet I am still getting no agent alert when the code is present, and always I am getting an agent alert when the code is absent...

                I also attempted to modify the "$ticket->getSubject()" to "$this->getSubject()" (since that seems to be used in this file), but that didn't make any difference either...

                Not sure exactly what I am doing wrong here, but seemingly the presence of this code might be causing an error (??)...

                I included a screenshot above, does what I have there seem okay ??

                @KevinTheJedi

                Sorry Kevin, I think we cross-posted there...

                To be clear, the testing I was doing was on my original test ticket (the one that generated the headers I provided earlier), so I did not create a new ticket (per your most recent post)...

                I was using forward-slashes for the filename there, however like I mentioned, I was not even changing the subject line at all (not putting in the "Testing123") and just the presence of that code (under those conditions) was causing the agent not to receive an alert (from my home account, which works), and would always receive an alert when the code was absent...

                So I think something is wrong and that code is throwing an error (even with the code not branching into the if statement)...

                Is there something else wrong??

                Perhaps if I create a video of me doing all of that it might make more sense?? Should I do that??

                ... Would you be willing to remote in here with me? That might make this easier too (I am good with whatever)...

                @TPK

                Okay, well it seems like you'll need to do some var_dump()ing without all the extra stuff (see snippet below), temporarily disable cronjob/scheduled task (so you don't have multiple cron jobs running), and just run cron manually via CLI:
                php C:\inetpub\wwwroot\Helpdesk\api\cron.php

                There you will get output to the command prompt.

                       var_dump('Subject: ', isset($vars['subject']) ? $vars['subject'] : $ticket->getSubject());
                       var_dump('Poster: ', $vars['email']);
                       var_dump('Alerts: ', $alerts);
                       var_dump('Autorespond: ', $autorespond);

                Cheers.

                • TPK replied to this.

                  KevinTheJedi

                  Okay, now we are getting somewhere 🙂

                  I replied to my test ticket from my (Home) account (the one that works), and I ran the cron manually... See the output below:

                  C:\Users\redacted>"C:\Program Files (x86)\PHP\v7.4\php.exe" C:\inetpub\wwwroot\Helpdesk\api\cron.php
                  string(9) "Subject: "
                  string(22) "Test ticket from yahoo"
                  string(8) "Poster: "
                  NULL
                  string(8) "Alerts: "
                  bool(true)
                  string(13) "Autorespond: "
                  bool(true)

                  So "Poster" is null? Can that be right?

                  KevinTheJedi

                  Yep, I see that I am still running php 7.4 for my automated cron job (when we should be running 8.0)... I need to fix that in my windows scheduled task...

                  However when running with php 8.0 I get the same thing (doesn't matter)...

                  C:\>"C:\Program Files (x86)\PHP\v8.0\php.exe" C:\inetpub\wwwroot\Helpdesk\api\cron.php
                  string(9) "Subject: "
                  string(22) "Test ticket from yahoo"
                  string(8) "Poster: "
                  NULL
                  string(8) "Alerts: "
                  bool(true)
                  string(13) "Autorespond: "
                  bool(true)

                  KevinTheJedi

                  Also, when I send a reply in from my yahoo account, I get no output from running the cron job from the command prompt... Nothing at all.. And I get no agent alert or confirmation response back to yahoo..

                  ... Yet the reply does seem to process into the ticket ... I can see it there in the portal ...

                  So it looks like this code is never hit, when I reply from my yahoo account (but is hit when I reply from my home account)... And it looks like the email is being processed for the ticket ...

                  Is that helpful??

                  ... Again, I appreciate this so much, thank you!

                  Oye, it seems I must have hit some kind of posting limit, and now my most recent posts are "awaiting approval"....

                  Anyhow, hopefully you will be able to see my posts...

                  And to be clear, when I did get the output back, when I posted from my home account, I did get the agent alert and the message confirmation... So that did work...

                  I got no output when replying from the yahoo mail user, and did not get the agent alert or the message confirmation...