I wanted to be able to do a trigger based on the attachments in the ticket, but since there is no option for that, I figured I could just do some console actions. I am wondering if anyone has a method that allows reading the contents of an attachment? I’ve gotten to attachments.find_or_initialize_by(:filename => “filename.json”) to find the attachment, but I can’t find a method that allows me to actually read the contents.
On a related note, just because I think anyone that can answer this would also be able to answer this related (to me) question:
What is the most effective console command for listing all tickets that are in state “new”?
@MrGeneration as per your suggestion I have initiated the work to update to the latest version.
I Was wondering about two more things, and then I promise I can figure everything I need out after that
Again, through console, is there a way to:
Add a note to a ticket, in the way a trigger would.
Send a reply to the customer_id that started the ticket, preferably as much as possible in the same style as the auto-reply trigger, but as a normal reply would also work
All this is an attempt to react to, parse and respond to the abuse format XARF by Abusix. If I am reinventing the wheel for something that has already been implemented, feel free to lambast me.
The auto reply notification template is not available for “normal” usage in that scope. Technically parts of the information they provide can be added to the mail though (with variables and all that if needed).
If you take a look at the documentation (and especially the response payload which is what you’ll need), then you should be able to construct a article of type “email”.
Note that Zammad expects a email address, not ID in that scope. You can sneak peek at any other fitting email article in Zammad which should be a good safety net for you.
No, I was trying to parse and display XARF reports in-line. They come as a mail with a file called xarf.json. So take the contents of the file, parse out some things, put those things in a comment on the article, and reply to the sender that the xarf has been received and parsed. You can see more about xarf here:
I think the easiest way may be to parse it in the console then send a request to the API to create the comment and then maybe have some kind of trigger that reacts to that and sends a reply to the sender. Feels a bit backwards, but I realise it is a special case.
I will be honest, I think that webhook based fire towards an endpoints that then can handle all the needed steps (two articles, one as internal note, one as email towards the sender) and whatever is needed on top of that. I believe that approach would be better to be honest.
I am assuming that abuse mails go into an independent group for that case. I would strictly try to divide those kind of things which would make all the handling easier.