/build/static/layout/Breadcrumb_cap_w.png

"Undelete" Ticket Work

I've put in a feature request to disable the ability to remove "Work" entries in help desk tickets, but for the time being I've created a custom rule to "undelete" work entries. When work entries are deleted, they are simply hidden ("voided") - they are not permanently deleted from the database. Instead of using a rule, we can also report on work entries in the database to look for disrepencies. However, it is much easier to show all work entries in the tickets themselves.

Why would you care about this? Well, in my environment, we have multiple IT "groups" working in the same queues. Not that we plan on people maliciously removing work entries to make someone look bad, but we all know that it can and does happen. So, here are the select and update statements for the custom rule to automatically undelete all work when someone checks the "Delete" box next to an entry and saves. You can run the rule on a schedule or on ticket save, either way will work fine.

WARNING: This rule is not queue specific - it will undelete all work entries. I can help convert it to a queue specific rule if anyone is interested.

Select Query:
SELECT HD_TICKET.ID AS ID FROM HD_TICKET
JOIN HD_WORK ON (HD_TICKET.ID = HD_WORK.HD_TICKET_ID)
WHERE HD_WORK.VOIDED_BY IS NOT NULL


Update Query:
UPDATE HD_WORK
JOIN HD_TICKET ON (HD_TICKET.ID = HD_WORK.HD_TICKET_ID)
SET
VOIDED_BY = NULL
WHERE
VOIDED_BY IS NOT NULL AND (HD_TICKET.ID in (<TICKET_IDS>))

1 Comment   [ + ] Show comment
  • How can I undelete all tickets from a specific queue? Thank you - Emadabu 11 years ago

Answers (1)

Posted by: chris811 14 years ago
Orange Belt
1
Awesome!! exactly what I was looking for, I agree with you about deleting other's people work.
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