Delete the demo data for Digital Experience Score when you no longer need it.
Procedure
-
Navigate to .
-
Find and open the DeleteAggregatedDemoDataDexScore scheduled job.
-
Select Execute Now.
The job runs in the background.
-
Verify the completion status of the scheduled job.
-
Access the Pending Scheduled Jobs and Running Scheduled Jobs tables.
- Pending Scheduled Jobs: Navigate to .
- Running Scheduled Jobs: Navigate to .
-
Verify that the DeleteAggregatedDemoDataDexScore job isn’t listed in either of the tables.
-
Navigate back to the scheduled jobs list.
-
Find and open the DeleteDemoDataDexScore scheduled job.
-
Select Execute Now.
The job runs in the background.
-
Verify that the DeleteDemoDataDexScore job isn’t listed in the Pending Scheduled Jobs and Running Scheduled Jobs tables.
-
Delete records that are in the global scope.
-
Navigate to .
-
Enter the deletion script in the Run script (JavaScript executed on server) field.
var prefix = "[DEXScore Demo]";
//Deleting computer records
var comp = new GlideRecord('cmdb_ci_computer');
comp.addEncodedQuery('nameSTARTSWITH' + prefix);
comp.query();
comp.deleteMultiple();
//Deleting User Records
var userGR = new GlideRecord("sys_user");
userGR.addEncodedQuery('nameSTARTSWITH' + prefix);
userGR.query();
userGR.deleteMultiple();
//Deleting CMN Location Records
var location = new GlideRecord('cmn_location');
location.addEncodedQuery('nameSTARTSWITH' + prefix);
location.query();
location.deleteMultiple();
-
If the default value for the in scope field is not set to global, select global from the drop-down list.
-
Select Run Script.
Result
After both scheduled jobs run successfully and the script to delete records in global scope executes, the demo data is deleted from the instance.
If an error occurs during execution of the scheduled jobs, run the jobs again.