Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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,7 @@
Prevent Closure if the change tasks are open

1. Create a Before Business Rule.
2. Applicable to Change Request Table.
3. Use Before - Update.
4. Add conditions if required.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the change request have the active change tasks are still open then we can't proceed with the submission.

5. Apply the script.
Loading