- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2020 07:35 AM
HI All,
I have a requirement that if a task assignment group is XYZ and if Assigned to is NOT empty, I need to close the task marked "Closed Complete" within 3 Business Days (Monday to Friday between 9AM and 5PM) . Please guide
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 01:50 PM
If this has solved your problem, kindly mark the comment as a correct answer so that the question is moved to the solved list.
Regards,
Asif
2020 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2020 08:45 AM
Hi,
Try like this.
var gdt = new GlideDateTime();
var gr = new GlideRecord("sc_task");
gr.addEncodedQuery("assignment_group=sys_id^assigned_toISNOTEMPTY");
gr.query();
while(gr.next()) {
//get the created date
var created = new GlideDateTime(gr.sys_created_on);
created.addDays(3); //add 3 days for comparing.
if(created.onOrBefore(gdt)) {
//close the task
gr.state=3;
gr.update();
}
}
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 01:50 PM
If this has solved your problem, kindly mark the comment as a correct answer so that the question is moved to the solved list.
Regards,
Asif
2020 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2022 08:25 AM
is this a business rule?