After the state changes to Closed Complete, all corrective actions need to be verified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
what do you mean by corrective action? HR case has HR tasks associated to it
you can use before update business rule and validate if any HR task is open when HR case is about to close, if yes then abort the update
HR case should not closed if any HR task is open
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
36m ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
You can write a business rule or do a check in your flow by doing a query to the corrective action table. You can pass the hr case sys_id if corrective actions are not in a closed state you can abort action on the hr case and show an error message.
Example BR on HR Case table
When: Before Update
Conditions: State changes to Closed Complete
// Check if the case is being closed if (current.state == 'closed_complete' && previous.state != 'closed_complete') { // Query all corrective actions related to this HR case var correctiveAction = new GlideRecord('XXXXXX'); // Table name replace the XXXXX correctiveAction.addQuery('hr_case', current.sys_id); // Adjust field name if different correctiveAction.query(); var incompleteActions = []; while (correctiveAction.next()) { // Check if any corrective action is not in Complete status if (correctiveAction.state != 'complete') { // Adjust state value if different incompleteActions.push(correctiveAction.number.toString()); } } // If there are incomplete corrective actions, prevent closure if (incompleteActions.length > 0) { gs.addErrorMessage('Cannot close HR Case. The following corrective action(s) are not complete: ' + incompleteActions.join(', ')); current.setAbortAction(true); } }
