Attachments on Created Tickets

Hi

Not sure if it’s by design but I’ve found that attachments on a created ticket are not forwarded on to the CC users or the Requestor

What a timing! I was just about to post the same question.

I need to send the attachments, if any, to the CCs on ticket creation.

If instead of using On Creation, I use the On Transaction event then two emails are sent. One without the attachment (about the ticket creation) and one with the attachment (about the comment added in RT). This plan B would not work too well for our users as they will be confused with the two emails.

I thought that there was some hidden permission issues regarding the CCs. But since they can receive the attachments through the On Transaction events, I am not sure what the issue is.

Thanks

Inspecting the code, I wondered if that is possible.

I added some debugging statements into /opt/rt4/sbin/…/lib/RT/Action/SendEmail.pm and found that the On Create scrips are being called in a transaction that does NOT contain the attachments(s). The function ‘AttachableFromTransaction’ does not return anything when my On Create scrip is called. Inspecting the attachment table in the database, I can see that my attachment is in a further transaction number.

The ticket is created at a later stage and some other Transactions are created, indeed containing the attachment(s). But it is too late for the On Create depending scrips.

For example, on a dev system, I got a transaction ID of 652 when the scrips On Create are called. But the attachment was added at transaction 655.

As I experienced before, the On Transaction depending scrips do have access to the original attachments just after the ticket creation.

It is like we need a On Created event.

Anyone could think of an idea to solve that? In my case the On Transaction event has the drawback of being called for each transaction. It is called for the ticket creation (too early), for the RT automated first comment recording (seems to be the one I want, it contains the attachment), and for subsequent transactions (that I do not want).

Thanks,
Thierry

I found a possible solution (for my use case).

I created a scrip with a custom condition, simply checking if the current transaction has any attachment:
‘return $self->TransactionObj->Attachments->First;’

Action is ‘Notify Ccs’

The template has this first line: ‘RT-Attach-Message: yes’

That sent the attachments to the CCs on ticket creation.

What a timing! I was just about to post the same question.
I need to send the attachments, if any, to the CCs on ticket creation.

What version of RT are you on? Testing on my RT by creating a ticket and adding a Cc user I can see that the user got the message I put in the textbox along with the attached file.

Still using version: 4.2

Were you testing with 4.4?

I’m on 4.4.4 and just looking into what it could be now. I will try Thierry’s fix when I can

I actually only tested creating a ticket and confirming that the Cc user received an email. I tested on RT5. I believe this is what you were asking about @Thierry_Thelliez right?

Not sure if it’s by design but I’ve found that attachments on a created ticket are not forwarded on to the CC users or the Requestor

If you use the forward link on the create transaction in the ticket history instead of the “forward” option in the actions menu is the attachment forwarded? @Zetsumei

@Zetsumei Testing more, I realize that my fix has an issue. If there is no attachment, the CCs do not receive an email. Not what I want. I need to think of it more.