Setting due dates on Catalog Tasks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 05:33 AM
below is the script I found on this site for setting the due date on catalog tasks to match the due date on Request/RITM, which works just fine.
current.due_date = task.due_date;
var request = current.request.getRefRecord();
request.due_date = task.due_date;
request.update();
I have been asked if there is anyway we can add a formula in this advanced script area on the workflow that the due date would be 3 days AFTER the Request/RITM due date.
For example, the due date on the Request/RITM is 4/20, based on the creation date of today, but they want the due date on the task to be 4/23 instead?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 06:33 AM
Why would a subtask of a RITM be due 3 days after the RITM itself?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 06:36 AM
Because there are a set amount of catalog tasks that have to be completed before the RITM's due date. The item I am addressing is a Loaner Laptop request. ITS Teams have to do several tasks before the issue out the loaner laptop (closing the RITM). Make sense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2023 11:18 AM
We want the task due date to be 7 days before the due date. No variables in this catalog item or else I would have used this script.
var gdt = new GlideDateTime(current.variable_pool.end_date);
gdt.addDays(-7);
task.due_date = gdt;