Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function executeRule(current, previous /*null when async*/){
if(current.close_code){
var taskGR = new GlideRecord('change_task');
taskGR.addQuery('change_request', current.sys_id);
taskGR.addQuery('state', '!=', '3') // Adjust as needed
taskGR.query();

if (taskGR.hasNext()){
gs.addErrorMessage('You cannot close this change request until all change tasks are closed.');
current.setAbortAction(true); // Prevent saving the form
}
}

})(current, previous);
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Prevent Closure if the change tasks are open

1. Create a Before Business Rule.
2. Applicable to Change Request Table.
3. Use Before - Update Business Rule.
4. Add filter conditions if required.
5. Apply the Business Rule script.
6. If the change request have the active change tasks are still open then we can't proceed with the submission.
7. If required we can add few more query conditions.
8.
Loading