%{ticket.thread.lastmessage} shows not last message, but first
- Edited
That definitely doesn't sound right ? I notice that ticket.thread.lastmessage is expanadable beyond that point, and does describe itself as "Last Message" in the popout help. Additionally, you can select the 'Last message' canned response when replying and it selects the last message, exactly as you'd expect...
It's got me stumped... I'll fire up a clone of my live system and have a quick play around with things shortly to see if I can find what's happening. Hopefully somebody else can come up with an actual answer before then!
- Edited
RBGE Thanks for replying.
Could it be caused by us using the https://osticketawesome.com template? Could that mix up some things? We also have a "problem with" (or not understanding) search that nobody else seems to have (https://forum.osticket.com/d/94341-how-does-the-search-work-actualy/3)
- Edited
roberth I wouldn't expect osTicket Awesome to cause this issue, although I've just tested it on my clone system and %{ticket.thread.lastmessage} (without the .body part) includes the entirety of the user's last response, including the email header that was above the "-- reply above this line --" part.
If you're able to set up a clone too, it might be worth setting one up and restoring all of the stock files. If the issue is sorted there, you know the problem is due to osTicket Awesome and can report it on their forum (it's then up to you whether you revert to stock, or stick with the issue until it's fixed). If the problem still occurs with stock files, then there's an issue elsewhere.
Edit: note that I don't use osTicket Awesome - all of my testing is on the stock version
- Edited
RBGE Thanks. I'm using exactly the same field: %{ticket.thread.lastmessage} and just to be sure I just had a look at the Send Items mailbox of our support-mailbox.
I see that all our replies contain the original question in stead of the users last message. I will first ask the people from osTicket Awesome before setting up clone. See https://osticketawesome.com/forums/topic/ticket-thread-lastmessage-inserts-the-original-message/#post-4788
I also checked the canned response and that works as expected. The Last Message inserts the last message.
I will report back when I know more. Thank you.
I just tested it again with a new setup of osTicket and it doesn't work for me.
Here are the screenshots:
My Template:
The test-ticket
Last reply in Gmail:
You see that the original question is included. Not the client's last message saying that his "it's fixed now"
roberth That's odd, as it's definitely working as expected in mine (with apologies for excessive pixelisation!):
The template:
The ticket thread:
The final email received by the user:
This is a clone of my live system, with no mods and only official plugins (from osticket.com/download) to authenticate with AD and store attachments on the filesystem (so nothing that would modify ticket behaviour). I've honestly no idea where to look just now if yours is behaving strangely on a new install ?
- Edited
RBGE Really appreciate the effort.
Mine is a fresh download with only the Save Attachment to Filesystem plugin. Nothing else.
I was thinking about the sorting, Maybe it's sorted in the wrong way (last message = first). Maybe our language has something to do with it (localization). Or some language-setting on the database, but the canned response for "Last Message" inserts the correct part of the ticket. It's so strange.
I sometimes notie that the fields are 'mangled' after editing the template. E.g. url's for "agent ticket' is double encoded as URL or something, after you edit a template twice. Maybe it doesn't recognize the field correctly, but that's a bit far-fetched.
Maybe I can debug the PHP. Or at least I give it some time in the hope somebody else has a suggestion.
Thanks again for your support.
roberth Localisation really shouldn't have anything to do with this, but just to double check I installed the Dutch language pack to try again.
Ticket thread:
(I really have no idea what any of this says ? )
Email received:
So it's still doing the expected action with .lastmessage. I'm happy to give anything else a shot if you'd like me to check something, but I really have no idea what else could cause this.