- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 05:19 AM
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');
}
}
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 05:58 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 09:02 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader