RITM should get close once all catalog tasks are closed
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 06:14 AM
Hi Community,
I want the RITM should get close only once all the catalog tasks are closed. I have written the business rule for this after update with the condition as state is closed complete. But it's not working as per requirement. Can anyone please help on this.
var gr = new GlideRecord("sc_task");
gr.addActiveQuery();
gr.addQuery("request_item", current.request_item);
gr.setLimit(1);
gr.query();
if (!gr.hasNext()) {
var ritm = current.request_item.getRefRecord();
ritm.state = current.state;
ritm.update();
}
Thanks,
Tulasi.
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 08:54 PM
what debugging did you do? share the logs you added
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader