We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Business rule is not working properly for RITM closure

suryaogeti1
Tera Contributor

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

suryaogeti1_0-1784817883553.png

2.Prevention of RITM closure

suryaogeti1_1-1784818002913.png
3.Reopen RITM when an SC Task is Reopened

suryaogeti1_2-1784818122116.png

 

 

 

3 REPLIES 3

marianbruma
Giga Guru

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.

 

marianbruma_0-1784819299131.png

 

 

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.

@suryaogeti1 your first 2 scenarios should be handled by your workflow/flow.

Hi @marianbruma 

It is not working