Create a rule for send an email to specific KACE administrator when a new ticket arrive to specific Queue
I would like create a rule for send an email to specific KACE administrator when a new ticket arrive to specific Queue, a mean, if any user send a new ticket from any source (portal or email) can receive an email to a specific user that in this case is an administrator of KACE
You are probably best to run this as a ticket rule and run the rule every 15mins, as you can control the email content to the admin. As always, I suggest you use a custom field as a "switch field" so that you know only a single email is sent.
If you need help, build a simple ticket rule with the wizard and select a single field, so for example say if the status is Active then set the priority to Low.
Save the rule and then open the SQL, replace the "Status is Active" in the WHERE statement with SQL for if the ticket was created in the last 15 mins, something like
((TIMESTAMP(HD_TICKET.CREATED) <= NOW()
AND TIMESTAMP(HD_TICKET.CREATED) > DATE_SUB(HD_TICKET.CREATED,INTERVAL 15 MINUTE)) AND
HD_TICKET.CUSTOM_FIELD_VALUE4 = 1
**HINT** You can get the correct SQL by creating a report with the wizard then viewing the SQL
And in the update SQL just set your switch field to value 2
HD_TICKET.CUSTOM_FIELD_VALUE4 = 2
and configure the email to send to the Admin.
Here's another hint, set the Admin email address as the default value of a custom field, set to hidden.
You can then select the email address as a variable to use in the email
So in you SELECT Statement add in
HD_TICKET.CUSTOM_FIELD_VALUE5 as ADMIN_EMAIL,
You can then use ADMIN_EMAIL as the variable in the email config.
Depending on the load of your K1000, the every 15 min query might add a lot of load to the server if you have a lot of them. Instead of using the Wizard to create the Ticket Rule to run every 15 minutes, I would suggest just using New SQL rule to run on Ticket Save and check if the ticket created was created in the last 1 minute. To make sure you are not getting duplicates because someone added a quick comment, you can also check that there is only 1 change event which should be the Ticket Created event.
'email@example.com" as GROUPMAIL
HD_TICKET Inner Join
HD_TICKET_CHANGE On HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID
HD_TICKET.CREATED Between (Date_Sub(Now(), Interval 1 Minute)) And Now()
Count(HD_TICKET_CHANGE.ID) < 2
With that, you can use the option to "Email each recipient in query results". In the "Column containing email addresses" you would put "GROUPMAIL" from the query above to email the address(es) you specified in the query.