/build/static/layout/Breadcrumb_cap_w.png

Stop further Rules from running possible?

Sounds basic but I see nothing under the Rule config and can't seem to find a Post. I have a Rule that changes a Closed ticket to Opened if certain Categories are assigned. Works fine, but the EmailOnClose Rule sends the Submitter an email anyway. I don't want the Submitter to know until we get the Ticket right. I am thinking my rule can have a lower Order and stop further Rules from running. Possible?

0 Comments   [ + ] Show comments

Answers (5)

Posted by: Transam 12 years ago
Orange Belt
0
70 hits and no reply. Is this too dumb of a question or impossible?

I just want to stop further rules from running after my rule runs.
My rule's Update query is below, re-opens the ticket if HD_CATEGORY.NAME = 'New Email Ticket'

update HD_TICKET, HD_STATUS as T5
set HD_TICKET.HD_STATUS_ID = T5.ID,
HD_TICKET.TIME_OPENED = IF(T5.STATE = 'opened', NOW(), HD_TICKET.TIME_OPENED),
HD_TICKET.TIME_CLOSED = IF(T5.STATE = 'closed', NOW(), HD_TICKET.TIME_CLOSED),
HD_TICKET.TIME_STALLED = IF(T5.STATE = 'stalled', NOW(), HD_TICKET.TIME_STALLED),
HD_TICKET.SATISFACTION_RATING = IF(T5.STATE = 'closed', NULL, HD_TICKET.SATISFACTION_RATING),
HD_TICKET.SATISFACTION_COMMENT = IF(T5.STATE = 'closed', NULL, HD_TICKET.SATISFACTION_COMMENT)
where T5.NAME = 'Opened' and
HD_TICKET.HD_QUEUE_ID = T5.HD_QUEUE_ID and
(HD_TICKET.ID in (<TICKET_IDS>))


OR stop the EmailOnClose from working, maybe based on a value in a field that my rule sets (I tried this but failed)?
Current EmailOnClose below, note the condition "and (HD_CATEGORY.NAME not like 'New Email Ticket')"

select HD_TICKET.*, DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') as CREATED, DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') as MODIFIED,
HD_STATUS.NAME AS STATUS_NAME,
HD_STATUS.ORDINAL as STATUS_ORDINAL,
HD_IMPACT.ORDINAL as IMPACT_ORDINAL,
HD_CATEGORY.ORDINAL as CATEGORY_ORDINAL,
HD_PRIORITY.ORDINAL as PRIORITY_NUMBER,
STATE,
if((datediff(DUE_DATE, now()) = 0), 2, if((datediff(DUE_DATE, now())<0), 1, 3)) as SORT_OVERDUE_STATUS,
if(unix_timestamp(TIME_OPENED) > 0, TIME_OPENED, 1<<62) as SORT_TIME_OPENED,
if(unix_timestamp(TIME_STALLED) > 0, TIME_STALLED, 1<<62) as SORT_TIME_STALLED,
if(unix_timestamp(TIME_CLOSED) > 0, TIME_CLOSED, 1<<62) as SORT_TIME_CLOSED,
if(unix_timestamp(ESCALATED) > 0, ESCALATED, 1<<62) as SORT_ESCALATED,
if(unix_timestamp(HD_TICKET.CREATED) > 0, HD_TICKET.CREATED, 1<<62) as SORT_TIME_CREATED,
if(unix_timestamp(HD_TICKET.MODIFIED) > 0, HD_TICKET.MODIFIED, 1<<62) as SORT_MODIFIED,
if(unix_timestamp(HD_TICKET.DUE_DATE) > 0, HD_TICKET.DUE_DATE, 1<<62) as SORT_DUE_DATE,
case upper(STATE)
when 'CLOSED' then unix_timestamp(HD_TICKET.TIME_CLOSED) - unix_timestamp(HD_TICKET.TIME_OPENED)
when 'OPENED' then unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.TIME_OPENED)
else unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.CREATED) end as AGE,
if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME) as OWNER_NAME,
U1.FULL_NAME as OWNER_FULLNAME,
U1.EMAIL as OWNER_EMAIL,
if (U1.ID is null, 'z', concat('a', if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME))) as SORT_OWNER_NAME,
if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME) as SUBMITTER_NAME,
U2.FULL_NAME as SUBMITTER_FULLNAME,
U2.EMAIL as SUBMITTER_EMAIL,
if (U2.ID is null, 'z', concat('a', if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME))) as SORT_SUBMITTER_NAME,
if (U3.ID is null, 'z', concat('a', if ((LENGTH(U3.FULL_NAME) = 0), U3.USER_NAME, U3.FULL_NAME))) as SORT_APPROVER_NAME,
if(APPROVAL='rejected', 'Rejected', if(APPROVAL='info', 'More Info Needed', if(APPROVAL='approved', 'Approved', if(APPROVER_ID>0, 'Pending', ')))) as APPROVAL_STATUS,
Q.NAME as QUEUE_NAME
from (HD_TICKET, HD_PRIORITY, HD_STATUS, HD_IMPACT, HD_CATEGORY)
LEFT JOIN USER U1 on U1.ID = HD_TICKET.OWNER_ID
LEFT JOIN USER U2 on U2.ID = HD_TICKET.SUBMITTER_ID
LEFT JOIN USER U3 on U3.ID = HD_TICKET.APPROVER_ID
LEFT JOIN HD_QUEUE Q on Q.ID = HD_TICKET.HD_QUEUE_ID
LEFT JOIN MACHINE M1 on M1.ID = HD_TICKET.MACHINE_ID
where HD_PRIORITY.ID = HD_PRIORITY_ID
and HD_STATUS.ID = HD_STATUS_ID
and HD_IMPACT.ID = HD_IMPACT_ID
and HD_CATEGORY.ID = HD_CATEGORY_ID
and ((HD_STATUS.STATE = 'closed')
and (HD_CATEGORY.NAME not like 'New Email Ticket')
and HD_TICKET.RESOLUTION not like '%Closed Email Sent')
and HD_TICKET.HD_QUEUE_ID = 1


Comments and suggestions are welcome.
Posted by: dchristian 12 years ago
Red Belt
0
One thing you might want to try is setting one of the custom fields to 'x'.

Then you can have your other rules check to see if x is set or not.

If it is then you know to stop.
Posted by: Transam 12 years ago
Orange Belt
0
Thx D but I tried to essentailly do that by adding "and (HD_CATEGORY.NAME not like 'New Email Ticket')" in the where clause of the 'EmailOnClose' select query (code in above post). I was thinking that the select should then NOT find that ticket.

If I set another field then I have to unset it. Ugh!

I simply do not want an email sent if the Category is "New Email Ticket". Seems to me my first Rule would fire, see that the Category is "New Email Ticket", change the Status to from Closed to Opened and the EmailOnClose query would not find the ticket because the ticket Status is no longer Closed. Too simple I guess.

Is there somehting wrong with my select query for EmailOnClose that I could change so it does not find the ticket and send the email?
Posted by: dchristian 12 years ago
Red Belt
0
hmm...

It should work, which leads me to think its a silly mistake somewhere...
and (HD_CATEGORY.NAME not like 'New Email Ticket')
^this line kinda stands out. Your using a like but don't have the wild cards around the name.
EX: '%New Email Ticket%'

Double check everything.

Open up a query browser and see what results your getting.
Posted by: Transam 12 years ago
Orange Belt
0
Yeah, I tried one % at the front, one at both ends, nada.

Where would I find the query browser?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

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