Change Approval should be Automatic once Risk Assessment Completed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Hi,
Present in change Request once we click on the Request Approval button then Approval are triggered. But we need this step to Automate. Once Request is created and Risk Assessment is Submitted then Approval should be Automatic without Clicking the button.
I tried to do this in flow by checking the assessment record that attached to change. But i am unable to check that because in look ups record is not fetching as this won't wait till assessment is submitted.
Can anyone help in this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
@wefw - there are multiple way we can implement this, please refer below and chose what suites your requirement-
Option 1: Business Rule on Assessment Instance (Recommended)
This is the most direct and recommended method for its reliability and performance.
Target Table: asmt_assessment_instance
When: After Update
Condition: State changes to Complete
Script: The business rule's script will trigger the approval workflow and link back to the change request using the asmt_assessment_instance.task_id field.
Option 2: Business Rule on Metric Result Table
This is an alternative that triggers when the individual metric results are finalized.
Target Table: asmt_metric_result
When: After Insert
Condition: When all metric results for a given assessment instance have been created.
Action: The business rule checks if the assessment instance is complete and then triggers the approval automation for the linked Change Request.
Option 3: Flow Designer Trigger
This option is more user-friendly and provides a visual way to manage the automation logic.
Trigger: Record Updated on the Assessment Instance (asmt_assessment_instance) table.
Condition: State is Complete.
Actions: The flow will then perform actions, such as looking up the Change Request and asking for approval.
Detailed Implementation Steps
Step 1: Identify Assessment Completion
The first step is to monitor the asmt_assessment_instance table. You will check when the state field changes to Complete and verify that the task_id field correctly links back to your Change Request.
Step 2: Create the Automation Logic
Use either a Business Rule or a Flow Designer trigger. The automation should query the Change Request using the assessment's task_id and then execute the approval workflow programmatically.
Step 3: Trigger the Approval Process
Once the automation is initiated, the following actions should be taken on the Change Request:
Set the Change Request state to "Assess" (ready for approval).
Update the approval field to 'requested' (current.approval = 'requested').
If using Flow Designer, utilize the "Ask for Approval" action.
Step 4: Add Validation Controls
To prevent manual approval clicks before the assessment is complete, enhance the UI Action for approval.
Condition: Add a condition to the UI Action that queries the asmt_assessment_instance table to ensure a completed assessment is linked to the current change. This will hide the approval button until the assessment is finished.
Key ServiceNow Tables
Table Name | Purpose |
asmt_assessment_instance | Stores the overall status of an assessment. |
asmt_metric_result | Stores the results for individual questions. |
change_request | The target record for the approval. |
sysapproval_approver | The table where approval records are created. |
Best Practices
Use Flow Designer for new implementations as it offers better maintainability and an intuitive interface.
Add proper error handling and logging to ensure the automation is robust.
Test thoroughly with various risk assessment scenarios to validate the functionality.
Use UI Action conditions to prevent users from manually triggering approval prematurely.