How to send reminder after 14 days if task is open

Dasari Srihari
Tera Contributor

Hi All,

 

I need to send notification for opened Catalog Tasks after 14days only one time. I have created variable called reminder(Checkbox variable) after 14days we need set this value true same time we need to send notification,

 

i need to send notification to assignment group, 

 

Please find my script below:

 

var task = new GlideRecord("sc_task");
task.addEncodedQuery('request_item.cat_item=36db14d8db7043005eb551b0cf96196a^stateIN-5,1,2');
task.query();

while (task.next())
{
var text = task.request_item.variables.reminder;

if(text == ' '){

task.text = true;
task.update();
//gs.eventQueue('Test');
}


}


 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Dasari Srihari 

why not use Flow designer for this with no script?

1) Flow triggers every day and checks which sc_task is opened from last 14 days

2) for each of that sc_task send email and update the variable

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

@Dasari Srihari 

why not use boolean field true/false instead of incrementing the count?

It would be easier to update

After send email you can update the flag as true.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader