Flow Designer Approvals on Request approve all RITMs on first approval

Amy McManigle
Tera Contributor

We are trying to convert a Workflow to a Flow Design. The Workflow approves at the sc_request level. Depending on the department and the Requested For’s position in the organization there may be several  tiers of approval.
The problem is the Request approves all the related RITMs on the first approval before it completes the flow.

We have tried the following work around without success

Picture1.png


Requirement: all approvals should be complete before the RITM(s) are approved and fire off their first sctask.
Thank you

1 REPLY 1

Abbas_5
Tera Sage
Tera Sage

Hello @Amy McManigle,

 

To approve all ROOMs on the first approval in ServiceNow Flow Designer, you can utilize the "Ask for Approval" action and configure its rules to automatically approve all related ROOM records when a single approval is granted. 
 
Here's how to achieve this:
  1. Create a Flow: Begin by creating a new flow in Flow Designer. 
     
  2. Add the "Ask for Approval" Action: Include the "Ask for Approval" action in your flow. 
     
  3. Configure Approval for the Main Request: Set the "Record to Approve" to the main request record (e.g., RITM or INC). 
     
  4. Define Approval Rules: This is the key step. You'll need to define a rule that automatically approves all related ROOM records when the main request is approved.
    • Use a Script: Create a script within the "Ask for Approval" action's rules section. 
       
    • Script Logic: The script should:
      • Identify the related ROOM records based on a relationship field (e.g., a foreign key on the ROOM table pointing to the main request). 
         
      • Iterate through these related ROOM records. 
         
      • For each ROOM record, update its approval state to "Approved" or a similar state that indicates approval. 
         
    • Example Script (Illustrative):

       
        var room_records = new GlideRecord('room_table'); // Replace 'room_table' with the actual table name        room_records.addQuery('parent', current.sys_id); // Assuming 'parent' is the field linking ROOMs to the request        room_records.query();        while (room_records.next()) {          room_records.updateApprovalState('Approved'); // Replace 'Approved' with your desired approval state          room_records.update();        }
  1. Configure Approver and Due Date: Set the approver (user or group) and an optional due date for the main request approval. 
     
  2. Handle Approval Outcomes: Use "Flow Logic" (If/Then) to handle the approval outcome of the main request. If the main request is approved, the script will automatically approve all related ROOM records. 
     
  3. Save and Activate: Save and activate your flow. 
     
Explanation:
The key is to use a script within the "Ask for Approval" action to dynamically update the approval states of all related ROOM records when the main request is approved. This script should identify the ROOM records based on a field that links them to the main request and then update their approval states accordingly. By using this approach, you can ensure that all ROOMS associated with a single approval are automatically approved when the main request is approved. 
 
OR please refer to the below steps:
In ServiceNow, it's generally recommended to ensure all approvals for a Request Item (RITM) are complete before the RITM is approved and the first Service Catalog Task (SCTASK) is triggeredThis ensures proper governance and review of the request before work begins on fulfilling it. 
 
Elaboration:
  • Approval Flow:
    When a user submits a catalog item, a RITM is created, and an approval workflow may be initiated.
  • Approval Completion:
    Approvals are typically configured to require specific users or groups to approve the RITM before it can move forward.
  • Triggering SCTASKs:
    Once all required approvals are obtained, the RITM moves to an approved state, which can trigger the creation of the first SCTASK.
  • Why Complete Approvals First:
    • Governance: Ensures that requests are reviewed and authorized by the appropriate parties before work begins.
    • Accuracy: Reduces the risk of errors or incorrect fulfillment by verifying that the request aligns with organizational standards and policies.
    • Compliance: Helps organizations meet compliance requirements by ensuring that all approvals are properly documented. 

    If this is helpful, please hit the thumbs up button and accept the correct solution by referring to this solution in future, it will be helpful to them.

     

    Thanks & Regards,

    Abbas Shaik