Skip to main content

How can I set a task due date based on another date?

Use case:

HR submits an offboarding request item for an employee that is retiring in three weeks. The request item form includes a date and time to initiate the termination process - we will call this the Term D/T. A task is generated with the request item with a due in one hour BUT should start based on the Term D/T value on the request item form. 

I tried looking at custom objects but those seem very limited.

Any way to accomplish this?

Did you find any solution to this? I am looking for something like this.


How do you create the task?

Could use the API to create/update the tasks. 

https://api.freshservice.com/v2/#view_all_ticket_tasks


Hi @kcbates, if the task is added via workflow automator you will need to wait until we get the ability to execute a “Timer” node. This is coming down the pipeline soon I am told. The other option is to possibly look at using an Expression to take the “Term D/T” and add an hour to that time, then set that as the due by date/time for the task.

Then using the result (which btw should be of date/time not string, oops) you could trigger a webhook hitting the Task endpoint mentioned by @daniel.soderlund for the Freshservice API and create or Update the task due date/time. Hope that helps!


@daniel.soderlund  @kcbates 


Why not try webhook?

The following webhook, will create a task based on Service request field 
 

{

"due_date": "{{ticket.last working day | date: '%Y-%m-%dT%H:%M:%S'}}",

"notify_before": fifteen,

"title": "Revoke access",

"description": "Description",

"owner_id": 2,

"group_id": 1

}

Callback URL:

https://domain.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}/tasks


@daniel.soderlund  @kcbates 


Why not try webhook?

The following webhook, will create a task based on Service request field 
 

{

"due_date": "{{ticket.last working day | date: '%Y-%m-%dT%H:%M:%S'}}",

"notify_before": fifteen,

"title": "Revoke access",

"description": "Description",

"owner_id": 2,

"group_id": 1

}

Callback URL:

https://domain.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}/tasks

That was my idea as well, webhook or webrequest. 


@daniel.soderlund  @kcbates 


Why not try webhook?

The following webhook, will create a task based on Service request field 
 

{

"due_date": "{{ticket.last working day | date: '%Y-%m-%dT%H:%M:%S'}}",

"notify_before": fifteen,

"title": "Revoke access",

"description": "Description",

"owner_id": 2,

"group_id": 1

}

Callback URL:

https://domain.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}/tasks

This is a great idea too, Would this set the due date one hour after the “due_date” filled in date/time mentioned in the the initial request?? Or is this meant to still be used after gaining the “result” from the Expression node?


@daniel.soderlund  @kcbates 


Why not try webhook?

The following webhook, will create a task based on Service request field 
 

{

"due_date": "{{ticket.last working day | date: '%Y-%m-%dT%H:%M:%S'}}",

"notify_before": fifteen,

"title": "Revoke access",

"description": "Description",

"owner_id": 2,

"group_id": 1

}

Callback URL:

https://domain.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}/tasks

That was my idea as well, webhook or webrequest. 

I found this thread when trying to update a date field using placeholders and just wanted to say thank you for the date formatting part. Solved my problem!!


To set a task due date based on another date, you can calculate the due date by adding or subtracting a specific number of days from the reference date. as you can see on my honey site. Determine the time frame you want for your task and add or subtract that duration from the reference date to determine the due date.


Reply