No Attachments in Action Script - On Correspond

Hey Folks,

Long time reader first time poster. Hoping I might be able to get some advice on a problem I am encountering.

RT Version 4.4.2

I have an Action script “On Correspond” where I am attempting to take attachments from an inbound email response to a Ticket and process the attachment. The same code works for “On Create” and “On Comment” but not “On Correspond”. I am not sure where to look and have exhausted my google-fu trying to find a solution. Is there anything different about how “On Correspond” processes attachments?

** EDIT **
Confirmed this is not working with “On Transaction” either. So this is an issue with inbound email and $Transaction not “On Correspond”

Thank you in advance!

my $Ticket = $self->TicketObj;
my $Trans = $self->TransactionObj;
my $Attachments = $Trans->Attachments;
my $Template = $self->TemplateObj;

send_to_logs(“debug”, “START :: Process Attachments”);

while (my $attach = $Attachments->Next) {
if ($attach->Subject) {
send_to_logs(“debug”, “Attachment found $attach->Subject”);
my $timestamp = time;
my $filename = “RT-”. $RT_IN_ticket ."". $timestamp ."". $attach->Subject;
my $tmp_filename = “/tmp/$filename”;



}

send_to_logs(“debug”, “END :: Process Attachments”);

I don’t get any errors with the code, it works perfectly in other action scripts; however, with correspond I am not seeing any attachments.

(Log from On Correspond)

[24166] [Fri Sep 17 14:32:14 2021] [debug]: START :: Process Attachments ((eval 546):148)
[24166] [Fri Sep 17 14:32:14 2021] [debug]: END :: Process Attachments ((eval 546):148)

(Log from On Comment)

[24160] [Fri Sep 17 14:35:58 2021] [debug]: START :: Process Attachments ((eval 521):150)
[24160] [Fri Sep 17 14:35:58 2021] [debug]: Attachment found RT::Attachment=HASH(0x7fcc8035c980)->Subject ((eval 521):150)
[24160] [Fri Sep 17 14:35:58 2021] [debug]: Attempting to download attachments to /tmp/ ((eval 521):150)
[24160] [Fri Sep 17 14:35:58 2021] [debug]: Attempt to process complete ((eval 521):150)
[24160] [Fri Sep 17 14:35:59 2021] [debug]: Attempt to remove tmp file complete ((eval 521):150)
[24160] [Fri Sep 17 14:36:00 2021] [debug]: END :: Process Attachments ((eval 521):150)