/build/static/layout/Breadcrumb_cap_w.png

How to Add an email portion to a Custom Rule when Action Occurs

We created a Custom Rule that moves a ticket from one queue to another when certain keywords are present in the title. However, that has broken my notification rule in place on that second queue for when something gets moved to it.

To work around that, i'd like to add to my new Custom rule to "Email each recipient in query results"... I know the address I want to email when this happens, I just don't know how to add that SQL item to the original rule. Any help would be appreciated.

Here's my Select SQL verbage:

SELECT HD_TICKET.ID, HD_TICKET.TITLE,
HD_TICKET.HD_CATEGORY_ID, HD_TICKET.HD_QUEUE_ID,
HD_CATEGORY.ID, HD_CATEGORY.NAME
FROM HD_TICKET
JOIN HD_CATEGORY ON (HD_CATEGORY.ID = HD_TICKET.HD_CATEGORY_ID)
WHERE HD_TICKET.TITLE like '%tsteam%' OR
HD_TICKET.TITLE like '%hardware%' OR
HD_TICKET.TITLE like '%software%' OR
HD_TICKET.TITLE like '%PC%' OR
HD_TICKET.TITLE like '%printer%' OR
HD_TICKET.TITLE like '%Cisco%' OR
HD_TICKET.TITLE like '%phone%'
AND (HD_TICKET.HD_QUEUE_ID =2 OR HD_TICKET.HD_QUEUE_ID=2)
ORDER BY HD_TICKET.ID


Update SQL:

UPDATE HD_TICKET
SET HD_TICKET.HD_QUEUE_ID=1
WHERE HD_TICKET.TITLE like '%tsteam%' OR
HD_TICKET.TITLE like '%hardware%' OR
HD_TICKET.TITLE like '%software%' OR
HD_TICKET.TITLE like '%PC%' OR
HD_TICKET.TITLE like '%printer%' OR
HD_TICKET.TITLE like '%Cisco%' OR
HD_TICKET.TITLE like '%phone%'


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: chucksteel 7 years ago
Red Belt
1

Top Answer

You need to add a column to the select clause of the query that includes the email address. If it is a static email address then after HD_CATEGORY.NAME add ", 'user@domain.com' AS USEREMAIL". So the first part of the query should look like this:
SELECT HD_TICKET.ID, HD_TICKET.TITLE,
HD_TICKET.HD_CATEGORY_ID, HD_TICKET.HD_QUEUE_ID,
HD_CATEGORY.ID, HD_CATEGORY.NAME, 'user@domain.com' AS USEREMAIL
The column containing the email address will be USEREMAIL.




Comments:

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ