Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Last active April 7, 2023 23:06
Show Gist options
  • Select an option

  • Save cmcdevitt/410281d5d209dbb44f93abf6c7a2bf8b to your computer and use it in GitHub Desktop.

Select an option

Save cmcdevitt/410281d5d209dbb44f93abf6c7a2bf8b to your computer and use it in GitHub Desktop.
When a Vulnerable Item is reopened check if it is deferred first
/*
A VR scanner may "reopen" a "closed" VIT that has an Active Deferral... so stop that from happening
BR on sn_vul_vulnerable_item
When: Before - Update
Condition: State changes to Open
*/
var date = new GlideDate();
var current_date = date.getByFormat('yyyy-MM-dd');
//This is a 'light' check
if(current.ignore_expiration >= current_date){
current.setValue('state', 12);
current.work_notes = "The state was set to Deferred becouse there is an active Deferral";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment