- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 06:31 AM
Hello,
I am looking to add some logic to a Catalog item and am needing to set a Catalog Tasks due date to 5 days prior to a variable date.
On the catalog item, users are populating a "Go Live Date", go_live_date, and after submission I would like a catalog task to get a due date of 5 business days prior to the date the end user submitted.
I am having issues with getting this to work and would appreciate some help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 07:27 AM
then in the catalog task activity use Advanced script and use this
var dt = new GlideDateTime(current.variables.go_live_date); // give correct variable name here
dt.addDaysUTC(-5);
task.setValue('due_date',dt.getValue()); // give correct field name here
Something like this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 06:54 AM
you are using workflow or flow designer for this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 06:55 AM
if you are using flow designer then you can use inline script
something like this
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 06:57 AM
Hi @Ankur Bawiskar ! I am using Workflow!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 07:27 AM
then in the catalog task activity use Advanced script and use this
var dt = new GlideDateTime(current.variables.go_live_date); // give correct variable name here
dt.addDaysUTC(-5);
task.setValue('due_date',dt.getValue()); // give correct field name here
Something like this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader