How to use toggle script. I need to set automatic onhold in SCTASK in 30days

Jeck Manalo
Tera Guru

I am trying to create script to automatic set the onhold into 30days how can it be possible on the workflow using toggle script ?

 

find_real_file.png

1 ACCEPTED SOLUTION

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?

find_real_file.png

find_real_file.png

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

View solution in original post

8 REPLIES 8

Mahendra RC
Mega Sage

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

Hi Mahendra,

I need to put the date in this variable "On hold Date" using the toggle scripting

How can it possible to do that ?

find_real_file.png

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?

find_real_file.png

find_real_file.png

Please mark my respsone as helpful/correct, if it answer your question.

Thanks

Thank you for this. it works