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

Return to top
Have more questions? Submit a request

27 Comments

  • Sergio Anarte

    Hi James,

    How can we reproduce the next escenario within a trigger condition?

    Scenario: Trigger should be executed when a custom field contains the current date (i.e. today)

    - Custom Date field is within the next 0 days.

    We can't make it work, is there any workaround?

    Thank you.

    0
  • Andrew J
    Community Moderator

    Just to confirm, this is a trigger.. so you are updating the ticket yourself and want the trigger to fire when you submit it? As opposed to an automation that runs when the conditions are met. Is that correct?

    0
  • Kris Mendoza

    Hello!

    I'd like to know how to do the scenario that Sergio posted.  We are creating an "alert" for any customers who are within a certain contract renewal date and it's not working when we generate new tickets.

    We're using triggers as this only needs to fire when the ticket is submitted.

     

    Thanks,
    Kris

    1
  • Brett Bowser
    Zendesk Community Team

    Hey Kris,

    Any chance you could provide a screenshot of the trigger you have set up so we can take a look? You'll also want to keep in mind that these conditions work in multiples of 24 hours. So if you'd like the Trigger to fire within 48 hours of their contract renewal date, you'll need to use the within the next > 2 condition.

    Keep me posted!

    0
  • Kris Mendoza

    Hey Brett,

    I actually figured it out - I selected the wrong parameter in one of the conditions.  Thanks for the prompt reply though!

    0
  • Brett Bowser
    Zendesk Community Team

    Glad to hear it Kris :)

    Let us know if you have any other questions!

    0
  • Divya Arumugam

    Hey Brett,

    I would like to know how to set up a trigger for the scenario that Sergio has mentioned. I want to set up a trigger where a ticket status changes from 'on-hold' to 'open' when Custom Date field is 'today'

    Will the trigger work if I set the value '0' as shown below? Thanks in advance!

    1
  • Brett Bowser
    Zendesk Community Team

    Hi Divya,

    If you're want to re-open the ticket automatically, you'll want to use an automation instead of a trigger. Example screenshot for you below:

    I wouldl also recommend using Is within the next > 1 days instead of 0 as I'm not sure if the automation will fire then.

    Let me know if you have additional questions for me!

    0
  • Bart Brosens

    Hi there!

    @Brett,

    I wanted to use your "is within the next > 1 days " in a condition in a view, but It gives me an error:

    Basicly, I wanted to create a view where we can view the tickets where a custom date field has the date of today.

    Am i doing something wrong?

     

    Thanks

    regards

    Bart

     

     

     

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Bart,

    I was able to use this condition within a view on my own test account.

    What other conditions are you attempting to add to this view?

    I just used Status > Less than > Solved along with the due date condition.

    Let me know!

    0
  • Bart Brosens

    these are the conditions i'm using:

    0
  • Andrew J
    Community Moderator

    Hey Bart, try just 1 rather than >1.  I think Brett was just using > to show the steps.

    0
  • Bart Brosens

    Yea, I figured that was a misunderstanding of me.

     

    However, when I fill in “within the next 1 days”, it doesn’t give me the tickets where the custum date field is set for the current day.

    Only for tickets for the next day.

     

     

     

    0
  • Andrew J
    Community Moderator

    Sorry, I see this is for a view. Brett was talking about a trigger.

    What happens if you try 2 days?  Does that show the ones you want... and some?

    0
  • Bart Brosens

    I've experimented with this as well..

    Strangely, "within the next 2 days" only gives tickets dated "tomorrow", not "today"

     

    So far, I've only been able to create the tickets of "today" when I use "within the previous 1 day"

    So I think I'll use that

     

    Thanks for having a look! :)

    0
  • Andrew J
    Community Moderator

    Oh that is interesting.  But it does make slight sense.  The day has arrived, and therefore it is not longer upcoming. Makes some sense that it is now previous rather than 'next'.  I guess it is missing an option for "is  'TODAY' "

    Thanks for letting me know.

    0
  • Nick Rengers

    Following this topic I haven't figure out yet the best solution to take into account TODAY when calculating with a date ticket field for a trigger in Zendesk.

    As mentioned in previous replies the "is within the next" and "is withing the previous" is not taken into account TODAY.

    E.g.  Trigger to add specific tag to ticket when date is TODAY or in the future. When using "withing the next xxx" the tigger fires on all tickets D+1 (and d+2 d+3 etc) and not the tickets for which this date is equal to TODAY.

    Thanks for the feedback!

    0
  • Andreas Schuster
    Community Moderator

    Hi Nick Rengers,

    After a lot of trial and error with exactly this use-case, I found out that the following setup seems to work.

    Automation

    Ticket

     

    Maybe you give it a try, I would like to see if you see similar results.

    Cheers,
    Andreas

    0
  • Nick Rengers

    Hello Andreas Schuster,

    Thanks for your reply! I was trying to use Due Date but still without success. Can you elaborate your example a bit more into detail?

    By the way, I am not able to select the condition that you suggest in your comment. I can only select the following 2 options regarding the Due date:


    Where are you able in Zendesk to select this condition?




    The automation should do the following:

    When due date is TODAY or in the future--> add tag 1
    When due date is before TODAY (in the past) --> add tag 2

    With the date field I am able to make a difference between the past (d-1,d-2 etc.) and the future (d+1,d+2 etc.) but D (today) is not taken into account.

    Thanks again for your reply!

    Regards,
    Nick

    1
  • Andreas Schuster
    Community Moderator

    Hi  Nick Rengers,

    I forgot to mention that my "Due Date" field is a custom ticket field, this allows you then the various rules from my automation screenshot.

    Regarding your use case.

    I suggest 1 additional trigger which is added once you populate the field e.g. due_date_set
    As soon as the automation fires, remove due_date_set and add due_date_past

    I hope this makes sense, please let me know if it worked out for you.

    Cheers,

    -1
  • Peter O'Neill

    Interesting that the standard Due Date field is so bad that customers opt to build their own custom due date field. When the custom field has what I would consider a basic functionality of "date is today" or "date has arrived".

    I'm currently going through this struggle, and the fact that you need complex tagging systems or weird quirks/workarounds at all is highly frustrating.

     

    All I want is my custom date field to activate an automation saying "Follow-up date has arrived" and send out an email.

    2
  • Nicole S.
    Zendesk Community Team

    Hi Peter - 

    Thanks for that feedback. I see that this is your first post - welcome to the Zendesk Community! 

    I encourage you to share this comment in the Feedback on Support topic, which our product managers follow and will get notifications for. There, other users can also up-vote your idea. 

    0
  • Scott McClannahan

    I would agree with Peter O'Neill ... it seems silly that users must resort to making triggers and complex workarounds to do something as simple as "show me all tasks where custom field = today" or "show me all tasks where today > custom field" - these are BASIC FILTERS that any date field should be able to handle.

    I also noticed that you cannot use the built in date field (which only works on tasks btw) in an OR filter.  What if I want to say show me all tasks where the date is either > 7 days or the custom date past today.

    Can't do it.


    I just wish ZD would focus on the BASICS instead of putting development efforts into other features for us to spend more money on when the basics don't work well.

    2
  • Peter O'Neill

    Hi @Nicole the reason I don't move my comment to the "Feedback on support" is because it is essential a garbage bin collector for ideas. The search capability is so bad, common ideas never get consolidated, and the search capabilities are so bad that trying to do the leg work manually is frivolous.

     

    Your search capabilities seem to prefer content in the support advice category, allowing this post to receive more attention. Gathering comments and upvotes here where there is already traction, in my opinion, makes this a better place than to try and splinter the conversations even further.

    2
  • Nicole S.
    Zendesk Community Team

    Thanks for that feedback, Peter. I'll share it with the product teams as we work on improvements to the product feedback process.

    0
  • Tsveti

    Hi there, 

    I have an issue with "within the previous":

    I'm making an automation to perform an action when a date field is marked to be the day before the current day. So I'm using the following condition:

    - Date field - is within the previous - 1 days

    The action I want to perform is for one drop-down field to get updated automatically, but it doesn't work. 

    Can you help?

    0
  • Ben Van Iten
    Zendesk Community Team

    Hi Tsveti,

    • Are you saying that the automation doesn't run at all, or it does run and the field is not updated?
    • Are you able to pass along a screenshot of the rest of the automation conditions/actions as well?

    If the automation is running, and the field is not being updated, it might be worth checking the ticket events to see if another automation or trigger is resetting the value. If it isn't running at all I would recommend comparing the conditions with some example tickets to see if maybe the automation or your workflow needs to be tweaked.

    Thank you!

    0

Please sign in to leave a comment.

Powered by Zendesk