- 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:36 AM
Hello Jeckson,
Please check once if the below script helps you:
var nd= new GlideDateTime(gs.nowDate());
var fd = new GlideDateTime(nd);
fd.addDays(30);
return fd;
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:53 AM
- 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 02:41 AM
Thank you for this. it works