When using a custom date field as a trigger condition, what does "is within the previous" and "is within the next" do?



Edited Feb 10, 2025


6

25

28 comments

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


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


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


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


I ended up here while googling how to have a trigger fire on the day an agent specified in our custom date field.

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


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:

{
	"ticket": {
		{% capture today %}{{ "now" | date: "%Y-%m-%d" }}{% endcapture %}
		{% if ticket.ticket_field_xxxxxx == today %}
		...
		{% endif %}
	}
}

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:

{
	"ticket": {
		"custom_fields": [{
			"id": xxxxxx,
			"value": null
		}]
	}
}

Hope this helps someone else :)

0


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


Hallo Patrick,

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


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


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:

Date field timestamps are more complicated because they are not exposed in the UI or API. Automations currently use UTC timestamps for custom date field conditions. They do not use the time zone associated with the account. As a result, depending on how far the account is from UTC, automation may appear to fire several hours early or late.

 

1


Sign in to leave a comment.