a Ticket rule to manage Ticket rules (one rule to rule the rules!)
I want to use multiple queues within my company, but a question of maintenance comes up: How do you manage your ticket rules?
The two queues are going to be identical in functionality (just different categories) but for rules that run on frequency RUN ON TICKET SAVE are only triggered when a ticket is saved within the queue the ticket rule exists. Timed rules I can set to run in multiple queues without issue.
Because of this I have to duplicate ON TICKET SAVE rules between the queues, which leads to the management issue. If I update one ticket, that means I have to update the other (or more!).
My idea is to have a ticket rule that runs on a schedule (or just a RUN NOW rule) that takes the ticket rule in HD_QUEUE_ID 1 and, if the ticket rule in queue 10 has the same TITLE as the one in queue 1, updates it to match.
So, the idea is born, but I am of neophyte rank with SQL. Although I've done a good job working around the USER and HD_TICKET tables, I stretch my knowledge picking through a SINGLE table and checking itself.
select distinct HD_TICKET_RULE.TITLE,
PARENT.TITLE as PARENT_TITLE,
HD_TICKET_RULE.ID,
HD_TICKET_RULE.FREQUENCY,
HD_TICKET_RULE.HD_QUEUE_ID,
PARENT.HD_QUEUE_ID as PARENT_QUEUE_ID,
HD_TICKET_RULE.SELECT_QUERY,
HD_TICKET_RULE.UPDATE_QUERY,
HD_TICKET_RULE.EMAIL_BODY
from HD_TICKET_RULE
join HD_TICKET_RULE PARENT on PARENT.TITLE = HD_TICKET_RULE.TITLE
So, there is what I have, which isn't much at all.
In paradise I want the select query to find the PARENT ticket rule (which is going to be in HD_QUEUE_ID = 1) and then find the child ticket rules (which are in HD_QUEUE_ID <>1) and then match the parent's SELECT_QUERY and UPDATE_QUERY and EMAIL_BODY to the child's, based on the HD_TICKET_RULE.TITLE matching.
make sense? Help?
Answers (0)
Be the first to answer this question
basically. - Wildwolfay 11 years ago
I haven't taken the time to sit down and write something out to try and make the connections.
Remember though, any TIMED rules can fire off on any queue and effect any other queue as long as AND HD_TICKET.HD_QUEUE_ID = ## is within the ticket rule.
The only ticket rules that need to be duplicated between queues are rules that fire off "ON TICKET SAVE."
Maybe you can sit down and play with the ID if you are any good with SQL or know someone that is? I feel like this is simple for the experienced folks but I can't seem to get it :( - Wildwolfay 11 years ago