How to delete a ServiceNow Vulnerability Response VCA that has no VIT or VUL attached?

RH - CP
Kilo Contributor

We recently added the Vulnerability Response module to our ServiceNow instance at our company. During our early days of figuring out how to properly create VULs to group similar VITs, we now have 3 VCAs with no VIT or VUL included. How do we delete the VCA, without having the ability to click on a VIT or VUL within that VCA?

1 ACCEPTED SOLUTION

joe_harvey
ServiceNow Employee
ServiceNow Employee

By VCA I assume that you mean Vulnerability Change Approval

If so, you will probably have to delete orphaned approvals with a Fix Script:

  1. Navigate to: sn_vul_change_approval.list 
  2. Find sys_id's of the record that you want to purge
  3. Set your Application Scope to Vulnerability Response
  4. Navigate to: System Definition > Fix Scripts
  5. Create a Fix Script similar to the following and run it for each VCA sys_id:
var badVCA_ID = "917ae8e6db4c47007a5a596e5e961904";

var grVCA = new GlideRecord('sn_vul_change_approval');
if (grVCA.get(badVCA_ID)) {

gs.info("Deleting: " + grVCA.sys_id)
grVCA.deleteRecord();
}

I hope that this helps,

--Joe

View solution in original post

2 REPLIES 2

joe_harvey
ServiceNow Employee
ServiceNow Employee

By VCA I assume that you mean Vulnerability Change Approval

If so, you will probably have to delete orphaned approvals with a Fix Script:

  1. Navigate to: sn_vul_change_approval.list 
  2. Find sys_id's of the record that you want to purge
  3. Set your Application Scope to Vulnerability Response
  4. Navigate to: System Definition > Fix Scripts
  5. Create a Fix Script similar to the following and run it for each VCA sys_id:
var badVCA_ID = "917ae8e6db4c47007a5a596e5e961904";

var grVCA = new GlideRecord('sn_vul_change_approval');
if (grVCA.get(badVCA_ID)) {

gs.info("Deleting: " + grVCA.sys_id)
grVCA.deleteRecord();
}

I hope that this helps,

--Joe

RH - CP
Kilo Contributor

Thank you Joe.  That was exactly what I was looking for.  Ryan