Skip to content

Issue 244 Reply Went To The Assigned Analyst

Ed Mozley edited this page Nov 4, 2026 · 1 revision

Reply went to the assigned analyst

Reported: #244 by duongtuanan, November 2026 Β· Module: Tickets Β· Fixed in: 4.9.0 (changelog #2729)


What you saw

On a ticket somebody else had assigned to you, Reply filled the To box with your own address, not the requester's. On a ticket you had assigned to yourself, Reply was addressed to the requester as normal.

Those two cases look contradictory, and the report was right to describe both. The difference between them turned out to be the whole bug.


What was actually wrong

The email that told you the ticket was yours

With the Assigned to an analyst email template switched on (#148, from 2.5.0), assigning a ticket to somebody else sends them a "this ticket is now yours" email. Assigning a ticket to yourself sends nothing, because there is nobody to tell.

Every email FreeITSM sends from a template is also saved into the ticket's conversation, so the conversation shows what the desk said. That is right for an auto-reply to the requester. It was wrong for the assignment email: that one is internal, addressed to a colleague, and saving it made it the newest message on the ticket.

How Reply picks who to address

Opening a ticket shows its newest message, and Reply addresses the person at the other end of that message:

  • a message that came in is answered to its sender;
  • a message the desk sent out is answered to its recipient, because the sender is the desk's own mailbox.

The second rule is what makes Reply work after an auto-reply or after your own last reply. But the assignment email was an outgoing message whose recipient was you. So Reply addressed you.

That explains both cases in the report. Someone else assigning the ticket created the internal email, and self-assignment never did.

It was two places, not one

  • Reply, as above, and the hint that says a ticket has no email address to reply to, which uses the same rule.
  • The portal. A portal set to show the requester third-party messages could show them the internal "this ticket is now yours" email, because it was in the conversation.

The fix

  1. Emails written for an analyst are no longer saved into the conversation. They are still sent, still recorded in the email send log, and the ticket's History gains a line such as Assignment email - Sent to Sam <sam@...>, written by the system. The check asks who the template was written for, not which event sent it, so any future analyst-addressed email is kept out too.
  2. Reply ignores older analyst-only messages. Tickets assigned before 4.9.0 already have those emails in their conversation. When the newest message went out to nobody but your own analysts (leavers included), Reply now addresses the requester. A message that went to the requester and a colleague still keeps its recipients, because that one was part of the conversation.

The old rows were not deleted or migrated. They carry nothing that reliably marks them as assignment emails, and deleting conversation history on every install during an upgrade cannot be undone. They now simply have no effect on Reply.

No database change was needed, so there is nothing to run after upgrading.


Files changed

File Change
πŸ”΅ includes/template_email.php analyst-audience emails go to the ticket's history (templateNoteAnalystEmail()) instead of the conversation
πŸ”΅ assets/js/inbox.js correspondentAddress() skips outbound messages sent only to analysts (outboundToStaffOnly(), analystEmails)
πŸ”΅ tickets/index.php the inbox.js cache-buster, so browsers load the fix

The code, side by side, with the reasoning for each choice: Telling the analyst a ticket is theirs - developer guide.


How it was proved

On a test install, never on real tickets:

  • Analyst A assigned a ticket to analyst B. The conversation gained nothing, History showed the assignment email with no analyst name, and Reply was addressed to the requester.
  • Control: A assigned a ticket to themselves. No email and no history line, which is the existing rule that self-assignment tells nobody.
  • Old rows: a ticket whose newest message was an outgoing email to an analyst, like those saved before 4.9.0. Reply went to the requester.
  • Control for "every, not any": an outgoing message to the requester and an analyst still replied to both.

Not proven automatically: there is no automated test of this path yet. The checks above were made by hand.


What this means for you

  • After upgrading to 4.9.0, Reply is addressed to the requester again, including on tickets assigned before the upgrade.
  • Old assignment emails still appear in the conversation of older tickets. They are harmless, and new ones are no longer added.
  • To see that an assignment email went out, look at the ticket's History or the email send log.

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Blue sky thinking

Bugs resolved

Links

Clone this wiki locally