- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 04:40 AM
Hi all,
I am facing a strange issue in catalog management.
Sometimes, RITM's state is not getting changed to closed complete even if all catalog tasks under it are closed.
Usually, its working fine, but some RITMs are not getting closed and I am not sure what might be the reason behind this.
Also, its not for specific item, its happening for any random item.
Has anyone faced such issue before?
Please let me know what should I check for this.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:10 AM
yes from workflow it's also possible.
Instead of updating multiple workflows you can have after update BR on sc_task to close RITM once all sc tasks are closed
something like this
you can use after update BR on sc_task
Condition: State [IS ONE OF] Closed Complete/Closed Incomplete
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.addQuery('active', true);
gr.query();
if(!gr.next()){
var ritm = current.request_item.getRefRecord();
ritm.state = 3;
ritm.update();
}
})(current, previous);
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
01-07-2025 06:24 AM - edited 01-07-2025 06:29 AM
yes, if you want it for all catalog items then go ahead with business rule on sc_task table.
Try this:
Table : sc_task
After Update BR with condition as State CHANGES TO Closed
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.addQuery('active', true);
gr.query();
if(!gr.next())
{
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.request_item);
ritm.state = 3;
ritm.update();
}
But this approach conflicts with flows and probably causes issues.
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:28 AM
Be careful using the BR approach. If you have a workflow that does one task then another, the BR could close the RITM before the second task is created, thereby killing the workflow. If you can narrow down the specific RITMs where this is happening, you may want to use a very specific condition if you decide to go this route.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:24 AM - edited 01-07-2025 06:29 AM
yes, if you want it for all catalog items then go ahead with business rule on sc_task table.
Try this:
Table : sc_task
After Update BR with condition as State CHANGES TO Closed
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.addQuery('active', true);
gr.query();
if(!gr.next())
{
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.request_item);
ritm.state = 3;
ritm.update();
}
But this approach conflicts with flows and probably causes issues.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:10 AM
yes from workflow it's also possible.
Instead of updating multiple workflows you can have after update BR on sc_task to close RITM once all sc tasks are closed
something like this
you can use after update BR on sc_task
Condition: State [IS ONE OF] Closed Complete/Closed Incomplete
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.addQuery('active', true);
gr.query();
if(!gr.next()){
var ritm = current.request_item.getRefRecord();
ritm.state = 3;
ritm.update();
}
})(current, previous);
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
01-07-2025 06:28 AM
Be careful using the BR approach. If you have a workflow that does one task then another, the BR could close the RITM before the second task is created, thereby killing the workflow. If you can narrow down the specific RITMs where this is happening, you may want to use a very specific condition if you decide to go this route.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 06:32 AM
I agree here.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2025 02:57 PM
I agree, a BR seems like a bad solution here. We have some workflows that have a task, then an approval, and then another task. That would not be possible with a BR that closed the RITM if all tasks were closed. The workflow should be doing it, not a BR.