/build/static/layout/Breadcrumb_cap_w.png

Update Query Help

How can I create an update query where it will move the ticket to another queue and also change the category to 'Other' that is in the new queue?

Two separate update queries that work are:

UPDATE HD_TICKET
SET HD_TICKET.HD_QUEUE_ID = 7
AND HD_TICKET.ID = <TICKET_IDS>

and

update HD_TICKET, HD_CATEGORY as T5
    set HD_TICKET.HD_CATEGORY_ID = T5.ID
  where T5.NAME = 'Other' and 
HD_TICKET.HD_QUEUE_ID = T5.HD_QUEUE_ID and 
        (HD_TICKET.ID in (<TICKET_IDS>))

0 Comments   [ + ] Show comments

Answers (2)

Posted by: airwolf 7 years ago
Red Belt
0
You can't move a ticket between queues by adjusting HD_QUEUE_ID unless both queues are 100% identical (same fields with the same IDs in the database). This is highly unlikely, so you'd have to build out the query to map field data appropriately when you move queues. It would work by just changing HD_QUEUE_ID, but most if not all of the field data would be in random/incorrect fields in the new queue.

If you weren't already aware, KACE does offer fee-based Professional Services to write this for you.
Posted by: cgsao 7 years ago
Yellow Belt
0
Thanks for your response.
I figured that out after breaking the system without a backup... oops. Anyways, our office does not want to spend the money on the professional services, so I combined everything in the same queue and use categories to separate it. 

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