- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 12:27 AM
I am trying to create script to automatic set the onhold into 30days how can it be possible on the workflow using toggle script ?
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 01:42 AM
Hello Jeckson,
So you should be able to set this field as per the script provided above. If you field is of Date type then you can use the below script:
var nd= new GlideDateTime(gs.nowDate());
var fd = new GlideDateTime(nd);
fd.addDays(30);
var dueDate = fd.getDate();
return dueDate;
This is what I have used and the due date is getting set on RITM table. do you want to set the on hold date 30 days later based on some other field value?
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 12:31 AM
Hi,
you can use Wait for Duration logic and give 30 days and then update the state
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 12:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 03:33 AM
Okay I took it otherwise.
you can use this inline script
var gdt = new GlideDateTime();
gdt.addDaysUTC(30);
return gdt.getDate();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader