- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 11:01 AM
Hi,
Does anyone know how to set a 'Due date' on the Document Task (sn_doc_task) when the task is created?
I haven't found any configuration for this, so I assume it needs to be scripted.
Has anyone worked on Document tasks and knows how to achieve this easily?
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 11:30 AM
@miro2 Couldn't find an option to specify due date except the script. You can create an onBefore insert business rule on sn_doc_task table as follows to set the due date to 3 days after the task creation as follows.
(function executeRule(current, previous /*null when async*/) {
// Check if due date is not already set
if (!current.due_date) {
// Create a GlideDateTime object for the current date
var dueDate = new GlideDateTime();
// Add 3 days to the current date
dueDate.addDays(3);
// Set the calculated due date on the task
current.due_date = dueDate;
}
})(current, previous);
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 11:30 AM
@miro2 Couldn't find an option to specify due date except the script. You can create an onBefore insert business rule on sn_doc_task table as follows to set the due date to 3 days after the task creation as follows.
(function executeRule(current, previous /*null when async*/) {
// Check if due date is not already set
if (!current.due_date) {
// Create a GlideDateTime object for the current date
var dueDate = new GlideDateTime();
// Add 3 days to the current date
dueDate.addDays(3);
// Set the calculated due date on the task
current.due_date = dueDate;
}
})(current, previous);
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 02:01 PM
Hi @Sandeep Rajput
Thank you for responding so quickly. Your solution worked perfectly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 09:47 PM
When you set up a participant on a document template, there is the option to use a document task template, and set the due date for the document task there.