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

Have more questions? Submit a request

20 Comments

  • Sergio Anarte
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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

    0
  • Brett - Community Manager
    Comment actions Permalink

    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
    Comment actions Permalink

    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 - Community Manager
    Comment actions Permalink

    Glad to hear it Kris :)

    Let us know if you have any other questions!

    0
  • Divya Arumugam
    Comment actions Permalink

    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 - Community Manager
    Comment actions Permalink

    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
    Comment actions Permalink

    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 - Community Manager
    Comment actions Permalink

    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
    Comment actions Permalink

    these are the conditions i'm using:

    0
  • Andrew J
    Comment actions Permalink

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

    0
  • Bart Brosens
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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

    0
  • Andreas Schuster
    Comment actions Permalink

    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,

    0

Please sign in to leave a comment.

Powered by Zendesk