What triggers the Activities when RITM close?

Dk nov
Tera Expert

Hello All,

 

When all scTask closes, it automatically closes the RITM and set the "closed" and "closed_by" value on work note Activities on RITM.  As shown in below pic.

Dknov_0-1767389507461.png

While in some of the RITM, it only shows 'state' and 'stage'. Due to this issue, Closed_by and Closed field on RITM shows empty. Can someone tell from where these value is coming from on Activities on RITM? If it comes workflow then I found it closes the last scTask and end the workflow? Not sure if I am missing anything in workflow. Or if scTask closes which triggers any BR to close RITM as well!

Dknov_1-1767389579700.png

 

4 REPLIES 4

Matthew_13
Mega Sage

Hi my Friend

This is actually normal OOB behavior, and the difference you’re seeing comes down to how the RITM is being closed.

When the last scTask closes, ServiceNow evaluates the RITM and updates its state/stage. The Activities stream only shows Closed and Closed by if those fields are explicitly set on the RITM record. If they aren’t set, they wont appear.

So in the cases where you only see state and stage, the RITM was closed by logic flow/workflow/BR that did not populate closed and closed_bywhich is common with some Flow Designer implementations or custom logic.

scTask itself does not write those fields. Something else must do it.

The fix is to make sure whatever logic closes the RITM Flow or BR also sets closed and closed_by consistently.

 

@Dk nov - Please mark as Accepted Solution and Thumbs Up if you found Helpful!!

Tejas Adhalrao
Tera Guru

Hi @Dk nov  ,

there is business rule on the task table :

TejasSN_LogicX_0-1767411787944.png

 this business rule calling the script include : 

TejasSN_LogicX_1-1767411842023.png

open script include defination

this updating your work notes:

TejasSN_LogicX_2-1767411931361.png

 

 

also you can check with script debugger  

 

Its_Sagnic
Mega Guru

Hi @Dk nov ,

Please check the solution below:

In ServiceNow, the population of closed and closed_by fields in the RITM Activity Stream is triggered by the transition of the record from an Active to an Inactive state. The presence or absence of these values depends on which automation mechanism handles the closure. 
 
1. The Trigger: Business Rules
The primary mechanism that populates these fields is the "Task Closure " Business Rule (BR). 
  • Condition: This BR runs when a record's active field changes from true to false.
  • Action: It automatically sets the closed_at (Closed) and closed_by fields to the current date/time and the current user. 
 
2. Why values are sometimes missing
If you only see "State" and "Stage" in the activities, but not "Closed" and "Closed by," it typically indicates that the active field was not updated to false, or the logic bypassed the standard closure BRs. This happens for three main reasons: 
  • Custom Automation: A Workflow or Flow Designer action might be setting the state to "Closed Complete" manually but forgetting to set active = false.
  • Inactive OOTB Rules: In some instances, the Business Rules "Set Active Flag After Workflows" or "Set Closure Fields" may be deactivated or customized, preventing the automatic toggle of the active flag when the workflow ends.
  • Task Closer BR Issues: The Out-of-the-Box Business Rule "task closer" (sys_id: 475ef3c5c611228401440a7a5f29a786) is responsible for closing the RITM once all sc_task records are finished. If this rule has been modified, it may fail to trigger the subsequent "Active = false" logic. 
 
3. ServiceNow Best Practice Justification
From a platform perspective, the RITM should ideally be closed by its Process Engine (Workflow or Flow Designer) rather than a separate Business Rule to ensure the lifecycle remains predictable. 
  • Workflow/Flow: When the final task closes, the workflow should reach an "End" node or a "Set Value" activity that sets the Stage to "Completed" and the State to "Closed Complete".
  • Verification: To fix the empty fields, ensure your workflow/flow explicitly updates the RITM to an inactive state or verify that the "Set Active Flag After Workflows" Business Rule is active to handle this automatically when the workflow completes
 
If you feel this helpful then please mark it as helpful....

Matthew_13
Mega Sage

@Dk nov _ Hello my Friend - Hopefully my solution worked for you?