Question
When I use a custom date field as a trigger condition, what do Is within the previous and Is within the next do?
Answer
Is within the previous and Is within the next evaluate conditions based on an integer number of days. Each day is translated into 24-hour multiples on the backend.
For example, Custom date field | Is within the next | 3 means the condition will evaluate as true when the timestamp of the custom date field is within the next 72 hours.
The timestamps for date fields are a more complicated issue since they’re not exposed anywhere in the UI or the API. In general, the hidden timestamp related to a custom date uses 00:00 to 23:59. When a trigger uses the condition Is within next | 1 day, the trigger would be expected to run at 00:01 onwards.
For more information about creating triggers, see the article: Trigger conditions and actions reference.
28 comments
AntonMi
We've built a simple “Resurrect” app to schedule when the ticket will reopen. It may be a solution for some of the use cases highlighted here.
1
Florian Kunz
Wir veranstalten Firmen-Events und ich würde gerne auf Grundlage des Datums dem Kunden eine E-mail senden. Beispiel: 10 Tage vor der Veranstaltung frage ich nach der finalen Teilnehmerzahl. Nach meinem Verständnis erhält der Kunde die E-Mail 10 Tage vor dem Seminar um Mitternacht UTC.
Gibt es eine Möglichkeit diese E-Mail auf z.B. 10 Uhr zu stellen und auch nur von Montag bis Freitag zu senden? Ich möchte vermeiden, dass die E-Mails bei unserem Ansprechpartner unter gehen.
Vielen Dank und mit besten Grüßen
Florian
0
Marta Nannipieri
Hi Jakob Kruse
Thanks for your reply! I did think of using “is within the previous 1 day”, although it would be too late - our team is based in the US, so the automation would reopen the ticket at 00:00 UTC of the following day, which would be the right day but too late (7:00pm).
Will submit a product feature request for “is today”.
Have a nice day!
1
Jakob Kruse
Hi 4887751576474,
I sadly ran into the same issue with the approach I described above. Automations require you to directly “nullify” at least one of the conditions that made them fire, so the status change or tag removal has to happen outside the API call - and therefore, outside the IF statement. But you need to use an automation because triggers can't be made to regularly re-check their conditions when the ticket isn't updated by something else.
What worked for us in the end was checking “is within the previous | 10”, which in our time zone fires on the correct date, and removing the relevant tag with a standard automation action. Here's the screenshots, sorry for German language:
It seems like you are solving basically the same problem that I had, having pending (or on hold) tickets reopen on an agent-defined day. If you need help with the surrounding triggers as well, let me know.
0
Marta Nannipieri
Hey Jakob, could you please tell me more about how you set this up? Where do you trigger that API call from? I tried to do it via an automation, but it's giving me an error (I want the automation to check if the Reopen date is today, and if it is reopen the ticket):
I am new to Zendesk so I am probably missing something stupid!
0
Jakob Kruse
I ended up here while googling how to have a trigger fire on the day an agent specified in our custom date field. It's very strange that standard trigger conditions offer all kinds of expressions w.r.t. that date, except checking whether it is today.
Anyway, after some more searching and trying things out I found a way to check this using Liquid tags within a call to the ticket API webhook:
Where
xxxxxx
is the custom date field's ID and...
can be replaced with whatever ticket update should happen.Also because someone asked, this piece of JSON sent to the ticket API webhook will reset the custom date field to be empty again:
Hope this helps someone else :)
0
Jimmy Rufo
Is there any way to implement a dynamic option similar to “within the next”, but instead its "after the next"? I'm using this trigger to set a ticket value based on upcoming renewal date of a client (i.e. within 6 months), based on a renewal date set in the client organization. This works seeming to remind of an upcoming renewal. However, I have no similar option to reset the ticket field value after the client has renewed, when the date of renewal in the organization is now presumably over 6 months away. The only option I have is a static date option which does not make sense at all. Please help!
As a really poor workaround, I have to use a condition where I use the “After or On” and pick a date that is over 6 months from now. I have to reset this trigger presumably every month with a new date that is over 6 months from now. I don't understand why we wouldn't have an option for “After the next 180 days”, where 180 is the variable to modified.
CC 4450048008986 1263082108669 - My leadership team has a requirement to be alerted of certain client tickets, where the renewal is upcoming, but it has to work the opposite way as well.
0
Anne Ronalter
bezüglich eines Feldes für Gewährleistung gibt es den folgenden Post in unserer Community:
Getting Data using a condition for "Warranty Start Date" Field
0
Patrick Lanwehr
Kann man das nicht etwas vereinfachen?
Ich versuche krampfhaft, eine Gewährleistung zu prüfen. Ist die Maschine noch in Gewährleistung soll ein Kontrollkästchen markiert werden. Aber ich möchte auch etwas Spielraum einbauen. Ein paar Tage NACH Ende der Gewährleistung soll weiterhin die Gewährleistung markiert sein.
Ich teste: Innerhalb der nächsten "0" und "1" und allen Kombinationen herum, aber nichts funktioniert.
0
Drew Kirkland
The reason that the notifications are firing the day before when using "within the previous" criteria is due to timezones.
The automation is using UTC time and does not account for local timezones. Here in US Central time, our automation opens tickets at 6pm on the day before our custom field (which is midnight UTC). From the support agent in my recent inquiry:
1
Sign in to leave a comment.