Change Due Date with Ticket Rule

I want to change the Due Date when a ticket is saved to add 2 weeks from the creation date. I currently have it setting the Due Date to the Creation Date, but can’t figure out how to add 2 weeks (14 days) to it.

update HD_TICKET as T
(T.ID in (<TICKET_IDS>))

What is needed to add those dates?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: airwolf 13 years ago
Red Belt
Use the DATE_ADD() function in MySQL:

update HD_TICKET as T
(T.ID in (<TICKET_IDS>))
Posted by: GillySpy 13 years ago
7th Degree Black Belt
This will work great.

Just nitpicking perhaps and if your not concerned about the time portion then this doesn't matter at all.

Keep in mind that the DUE_DATE field is a "DATE" field and CREATED is a TIMESTAMP field. After this update the time portion will be dropped which is effectively setting the DUE_DATE to the beginning of that day. Where I could see this coming into play is if you were expecting to compare DUE_DATE to a timestamp field you might not get the results you thought. This is because, the time portion for DATE field is implicitly midnight (00:00:00.000) For example, if a ticket was created at the end of the business day, when you add 14 days you will be 14days ahead but will be at the beginning of the 14th day rather than the end. This could cause the due date to come early.

In terms of SLA this will likely not hurt you by making some tickets come due "early".

Again, if your not concerned about the time portion or tickets coming due up to 1 business day early then just ignore what I said
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


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