In ServiceNow's Change Management process, managing complex approval scenarios, especially with parallel approvals, requires a good understanding of the approval engine and how different approval types interact with each other. When you have a mix of approvals generated through approval policies and custom script-based approvals, coordinating them can become challenging.
Based on your description, you've correctly identified that leaving the 'Approval' field empty on scripted approvals can help coordinate parallel approvals by ensuring they don't prematurely complete the approval process. However, the 'Apply Change Approval Policy' action does not offer the same flexibility directly. Here's a strategic approach to handling this complexity:
1. Revisiting Approval Policies:
The first step should be to revisit your Approval Policies to ensure they're configured in a way that fits into your complex requirements. Consider if these policies can be adjusted to align with the desired flow, such as setting conditions that must be met for approvals to be generated or adjusting the sequence in which approvals are procured.
2. Utilizing an And Condition:
For scenarios where multiple approvals are running in parallel, and you wish the Change Request (CR) to be approved only when all approvals are granted, you should ensure that your approval conditions act with an "AND" logic rather than "OR." This means configuring your process so that the CR’s final approval status is dependent on all individual approvals being granted, not just one.
3. Custom Scripted Business Rule or Flow Logic:
Given the limitations in directly handling 'Apply Change Approval Policy' with the same flexibility as custom scripts, consider implementing a custom business rule or adding logic in your Flow to check the status of all approvals before marking the Change Request as approved. This involves:
- Creating a Business Rule or Flow Logic that triggers on update of an approval record.
- Checking Conditions: When an approval is granted, the script checks if there are any other pending approvals for the CR. If yes, the process waits. If no, and all approvals are granted, then the CR is marked as 'Approved'.
- Coordination: For the 'Apply Change Approval Policy' produced approvals, ensure your script or flow includes logic to identify these approvals and includes them in the "all approvals granted" check.
4. Approval Coordinator Script Include:
Another sophisticated approach is to create a Script Include that acts as an approval coordinator. This script can manage the logic of checking all types of approvals related to a Change Request and make a determination on the CR’s approval status. This allows for more complex logic and can accommodate both the 'Apply Change Approval Policy' approvals and custom script-based approvals.
5. Testing and Validation:
Whatever approach you take, make sure to thoroughly test your solution. This testing should include scenarios with various combinations of approvals being approved in different orders to ensure the logic holds up under different conditions.
Conclusion:
Coordinating parallel approvals in ServiceNow, especially involving a mix of 'Apply Change Approval Policy' actions and custom script-based approvals, often requires a custom approach to ensure the approval process behaves as expected. Through careful configuration of approval policies, implementation of custom logic to coordinate the overall approval process, and thorough testing, you can achieve the required behavior for even the most complex approval scenarios.