Question

Set Task(s) due dates by another date

  • 26 October 2021
  • 8 replies
  • 640 views

Userlevel 3
Badge +4

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?


8 replies

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

Userlevel 7
Badge +13

How do you create the task?

Could use the API to create/update the tasks. 

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

Userlevel 7
Badge +16

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!

Userlevel 3
Badge +4

@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

Userlevel 7
Badge +13

@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. 

Userlevel 7
Badge +16

@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?

Userlevel 1
Badge +2

@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