Bulk change VIT state from Under Investigation to Open

Tom LeTourneau
Tera Contributor

Hello, we have an issue where we had deleted several Remediation Tasks and it has left a large number of VIT's in an Under Investigation state. Because of that Assignment Rules will not apply to the VIT's. Is there a way to change the state of a VIT in bulk to Open from Under Investigation? We have tried a new Remediation Task with a state of Open and then Closed-Cancelled it and that does not seem to work. Any advice would be appreciated!

2 REPLIES 2

Martin Dewit
Kilo Sage

Hi Tom, have you looked at those VITs via a List View? There should be a Bulk Edit UI Action that can bulk-update a set of VITs (1,000 at a time if they are not corrupted). Docs: https://docs.servicenow.com/bundle/washingtondc-security-management/page/product/vulnerability-respo... 

 

If those are not available for any reason for Bulk Edit, then you may need to create a background/fix script to correct the record states.

Satishkumar B
Giga Sage
Giga Sage

Hi @Tom LeTourneau 

You can use the bulk edit button on the vulnerable item list view to change the state from "Under Investigation" to "Open." This action will only update the state for those Vulnerable Items assigned to you. Here is a screenshot for reference. 

SatishkumarB_0-1722245778695.png


Background Script:

Additionally, you can use a background script to update the state as well. this takes all the records in consideration. please execute the below script. this will bring all the records to Open state.

 

var gr = new GlideRecord('sn_vul_vulnerable_item');
gr.addQuery('state', '2'); //query under investigation Record
gr.query();
if (gr.next()) {
    gr.setValue('state', '1'); // Set the state field to '1' for Open State
    gr.update(); // Save the changes to the record
}

 

 

 

Happy Learning

…………………………………………..
Mark it helpful 👍and Accept Solution !! If this helps you to understand.