- 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 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 06:07 AM
is this only for specific catalog task which belongs to particular catalog item?
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 07:10 AM
Hi @Ankur Bawiskar ,
Thanks for your response, I need to send reminder after 14days only one reminder, only for one catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 07:52 AM
then you can use a custom field on sc_task which will update as true to identify reminder is sent for this record
Then update the filter condition as well in flow while Looking up records
Example I shared below: Enhance it to use your boolean field instead of active which I shared in filter condition in flow
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 10:53 AM
Hi @Ankur Bawiskar ,
I will follow this process, whenever we are sending reminder how to update filed in task table,
I have created reminder count field if 0
value 0 after 14days flow will trigger reminder
Whenever reminder triggering i need to update Reminder field value to 1