We have set up our helpdesk with the rule to send out an email to members of a group when a new ticket is created, however we would like to have that email notification include all attachments that were submitted with the ticket. Has anyone done this or know if there is a guide somewhere to accomplish this? They need to be attached to the email so they can be viewed via smartphone/off the domain. I realize this could include large attachments, but our users only send screenshots and MS Office documents as attachments for the most part. Thank you!

We set up this rule: http://www.kace.com/support/resources/kb/article/How-To-Notify-Any-User-or-Group-by-Email-When-a-New-Help-Desk

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

To be honest wouldnt it be easier for them to go to the web portal to view images?

You could probably just create a rule which copies a link (i dont know if you could create an img src link for html email to point to them, maybe that folder has unauthenticated access?) to the attachment. Remembering that the default location for any attachments is as follows:

http://yourhelpdesk.com/packages/hd_attachments/%thechangeIDforthatpartiularchange%/image001.png  - they go up sequentially from there.

Therefor you could I guess create a ticket rule which queried on ticket save where HD_ATTACHMENT.FILE_SIZE>1 or not Null and have it get the change ID and create links for any files. It would be a lengthy process. The code below links all the HD_Ticket, HD_Ticket_Change and HD_Attachment which are the tables you'll need to look at.

 Select
*
From
HD_ATTACHMENT Inner Join
HD_TICKET_CHANGE On HD_TICKET_CHANGE.ID = HD_ATTACHMENT.HD_TICKET_CHANGE_ID
Inner Join
HD_TICKET On HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID
Where
HD_TICKET.ID = %TICKNUM%
Answered 09/19/2012 by: Roonerspism
Second Degree Brown Belt

Please log in to comment
0
I was just playing with this (in version 6.4) and figured out (by right-clicking on an attachment and selecting "Copy image address" and pasting it into Notepad) that the HD_ATTACHMENT.CHECKSUM needs to be added after the file name.

For example, the link to one of my attachment is:

http://kbox/packages/hd_attachments/screenshot.png.fd7afd7201a1de1b23703c1a2b91cfc3

Which is basically this:

http://kbox/packages/hd_attachments/
+
HD_ATTACHMENT.FILENAME
+
.
+
HD_ATTACHMENT.CHECKSUM

For example, here's a query that will return the link in a workable format (***as long as there are no spaces in the attachment's file name - in that case, additional logic would need to be added to handle those):

select 'user@company.com' as EMAIL,
T.ID as TICKET_NUMBER,
T.TITLE as TICKET_TITLE,
select T.ID, T.TITLE,
group_concat((case when C.DESCRIPTION like 'Added attachment%'
 then concat('http://kbox/packages/hd_attachments/',A.FILE_NAME,'.',A.CHECKSUM)
 else ''end) separator '\n') as ATTACHMENT_LINK
from HD_ATTACHMENT A
join HD_TICKET_CHANGE C on A.HD_TICKET_CHANGE_ID = C.ID
join HD_TICKET T on C.HD_TICKET_ID = T.ID
group by T.ID

I added the email address for use as an "Email each recipient in query results"-type ticket rule, although you could always join the USER table and have these go to the OWNER, SUBMITTER or APPROVER.

Hope that helps!

John
Answered 03/07/2016 by: jverbosk
Red Belt

Please log in to comment
0

I have been trying to determine a similar solution... it seems that even after generating the link to the attachment file, there is some difference when following the link from within the ticket and following the link on its own. The former simply downloads the file, the latter throws a permissions error. Has anyone found a possible solution to that?

This is the addition to our emails that I used to populate the link:

 

CASE WHEN C.DESCRIPTION like '%Added attachment%' then CONCAT('\n- Added attachment http://thd.lasell.edu/packages/hd_attachments/',C.ID,'/',FILE_NAME,'\n\n') else '' END AS ATTACHANGE,

Then use attachange var in the email output.

and yes you'll need to join the change table and attachment table as above.

 

From what I can tell its the same exact link as the attachment link in the ticket, however it only opens when coming from within that ticket and not from email or the browser directly.

 

Answered 02/21/2014 by: tholmes
Green Belt

Please log in to comment
Answer this question or Comment on this question for clarity