- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 03:10 PM
How do I delete Entities that are not related to any other record. I cannot even remove the Entity Filter in the Entity Type. We are going through a clean up effort on old data before we launch our go-live and this is the last remaining piece. Any help would be greatly appreciated!
Attached is the error I receive and I have confirmed that all related Control Objectives, Controls, etc. have been removed.
Solved! Go to Solution.
- Labels:
-
Policy and Compliance Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 06:33 PM
Thank you for the quick reply. We will test this out over the next couple of days and I will report back.
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 03:51 PM
Hi, the first question how do you delete entities not related to a record - there is a scheduled job "GRC Cleanup Invalid Profiles" which should ensure that any entities pointing to a record which is no longer valid are removed. e.g. if you scoped a load of CIs but they got deleted, or any other record, the entity is no longer required.
Remember, in NY v8? that independent entities were introduced.
The method called takes us to this:
_deleteInvalidProfiles: function() {
var profile = new GlideRecord('sn_grc_profile');
profile.query();
while(profile.next()) {
//Standalone Entities will not get deleted from this.
if(profile.table!='' && profile.applies_to!='') {
var record = new GlideRecord(profile.table + '');
record.addQuery('sys_id', profile.applies_to + '');
record.query();
if (!record.hasNext())
profile.deleteRecord();
}
}
},
you can see this caters for independent, or standalone, entities
However, the problem you are facing around the Entity type/Entity filter and the error you pasted is likely because you have some activity which got 'stuck'. This is fairly common, and possibly a Big T-Shirt... but for now, go to sn_grc_item_generation table and check, you will have some stale records in here which relate to the control objectives and records you have deleted.
Export the records from this table, in XML and XLS, and then you can delete them all. Then you will be able to perform the necessary deletion of entity type etc. That said, whatever it got 'stuck' doing will likely not be fully complete - and therefore you will need to refer to these exports and assess the integrity of your current GRC data. Typically in a delete/retirement scenario its not a problem, but if it was creation then you might need to give things a bit of a bump or jump-start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2020 06:33 PM
Thank you for the quick reply. We will test this out over the next couple of days and I will report back.
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2020 01:52 AM
Hi
Please look into the sn_grc_item_generation table. Set the 'running' status to complete for the entity part of the entity type you are cleaning up.
Then you wont get the error as in the screenshot.
Let us know if this works.
Good Luck!
Ashik