Business rule is not working properly for RITM closure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Team,
I have 3 requirements
1.Prevention of RITM closure (out of multiple sc tasks if any of the sc task is open, ritm should not close)
2.Auto close RITM after multiple tasks (RITM should auto close after closing associated sc tasks)
3.Reopen RITM when an SC Task is Reopened (if any of the sc task is reopen (work InProgress), the prevent ritm should reopen (work InProgress)
I have written all, all scenarios are working as expected. after closing the sc tasks , the RITM is auto closing , one of the sc task is kept work inProgress, the RITM is work in progress both are working but one scenario is not working as expected when is close the sc task again i.e., the reopen one, the RITM is not getting auto closing again after changing into work in progress .Please find below codes and help me wtih this
1..Auto close RITM after multiple tasks
2.Prevention of RITM closure
3.Reopen RITM when an SC Task is Reopened
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @suryaogeti1
I noticed a couple of issues in the Business Rule logic.
In the reopen rule, the condition does not specifically check that the SCTASK changed from inactive to active. I would replace it with:
if (!current.active.changesTo(true)) {
return;
}
Also, in your auto-close rule, the else block sets the RITM to Closed Incomplete whenever an active SCTASK exists. That conflicts with your requirement, the RITM should remain open while any SCTASK is active.
I would remove that else block and only update the RITM after confirming that no active SCTASKs remain. Then determine whether it should be Closed Complete or Closed Incomplete based on the final states of all child tasks.
For a new implementation, I would also consider handling the catalog task lifecycle in Flow Designer rather than coordinating three separate Business Rules. Service Catalog flows can create and wait for catalog tasks while keeping the RITM lifecycle in one place.
Flow Designer reference:
https://www.servicenow.com/docs/r/build-workflows/workflow-studio/create-sc-flow.html
Hope this helps. Please mark the response as Helpful or Accept as Solution if it resolves the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
45m ago
@suryaogeti1 your first 2 scenarios should be handled by your workflow/flow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
38m ago
Hi @marianbruma
It is not working