Skip to main content
Question

Use ticket automator to set due dates bases on create date

  • February 14, 2025
  • 3 replies
  • 41 views

How do I use the Automator to set the due dates for certain tickets +3 days out from the create date (date ticket is raised)? I don’t see optons in the automator to do this. Do I need to write a script? 

 

Essentially if ticket field = ‘x’ then set due date to create date + 3 business days.

 

Something like that..

Thank you!

Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+3
  • Contributor
  • 7 replies
  • February 17, 2025

From what you describe, it’s probably best to do this via the “SLA and OLA Policies” section of the admin area.
You can set up the “respond within” times and choose what conditions apply:
 


You’ve also got options for different response times based on these conditions *and* priority but you can just set all the priority options to be the same if that’s an unnecessary division of tickets.


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14
mpothen wrote:

How do I use the Automator to set the due dates for certain tickets +3 days out from the create date (date ticket is raised)? I don’t see optons in the automator to do this. Do I need to write a script? 

 

Essentially if ticket field = ‘x’ then set due date to create date + 3 business days.

 

Something like that..

Thank you!

You don’t want to use SLA ? I think it would be easier with a custom SLA kriterier. 

With automation you need to use a Expression and have date/time as output and then action to set the due date. 


Forum|alt.badge.img+6
  • Skilled Expert
  • 44 replies
  • February 19, 2025

If SLA is not an option, you can use the Automator but need to calculate the date manually using a script.
But its a bit more annoying to set up, so we chose to use SLA’s

Steps to create an automation rule:

  1. Go to Admin → Workflow Automator.
  2. Create a new automation with these triggers:
    • Event: "Ticket is Created"
    • Condition: "If ticket field = X"
  3. Action: Use a "Custom Action" (Requires a script).

 

require 'date' # Get the created_at date of the ticket created_date = DateTime.parse(event['created_at']) # Add 3 business days (excluding weekends) due_date = created_date 3.times do due_date += 1 due_date += 1 while [6, 7].include?(due_date.wday) # Skip Sat/Sun end # Update the ticket's due date { "due_by": due_date.strftime("%Y-%m-%dT%H:%M:%SZ") }

 


Reply