I need to set the due date of document task as employment start date of user
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 11:06 PM
Hi,
I need to set the due date of the document task as users employment start date. how to achieve this requirement.
If anyone worked on this requirement, please let me know.
Thanks.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 11:14 PM
I don't think anything OOTB is present for this
You can create before insert business rule on sn_doc_task table as follows to set the due date to 5 days after the task creation as follows, this is just an example, please enhance it further
(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 5 days to the current date
dueDate.addDays(5);
// Set the calculated due date on the task
current.due_date = dueDate;
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader