Re-opening tickets automatically based on Date

We have a seperate product where we store all our customer documentation. When a consultant does a project for a customer they would request access to the customers folder. We would then grant access to this folder.

Currently the consultant will log a ticket, and we grant access. Once we grant access we would close the ticket.

We now want to introduce a process where they detail how long they need access for (We will only allow a max of x days). Then when the days expire, the ticket opens again and we remove access.

My plan was to store a date in a UDF when the ticket should be reopened etc. Then have a scheduled task that looks through tickets that have todays date in the UDF, and change status etc.

I just need to piece together a few things:

  1. If they specify 20 days for example, how would I change this to a date in the future.
  2. How would I specify the scheduled task to enumerate todays date?

Thanks in advance for any help.


This is a very interesting idea! Here are a few building blocks you can use to create this:

To render the current date:


If you are storing that date in Autotask, be sure to configure the date helper to use the Autotask timezone (otherwise it will render in UTC):

{{date to_tz="Autotask"}}

If you have a property such as custom.time_diff that already contains text like 20 days, you can add the value of custom.time_diff to the current date and time like this:

{{date add=custom.time_diff to_tz="Autotask"}}

And if you need to modify the format of the rendered date string so it’s only the date, and not the time, you should add to_format="" to the helper, like this:

{{date to_format="Y-m-d"}}

To put it all together, you can store this value in the date UDF that establishes the date on which the ticket is re-opened:

{{date add=custom.time_diff to_format="Y-m-d" to_tz="Autotask"}}

Further reading: