How to delete gsw_change_log records

magicpanda
Tera Contributor

Hi, I am trying to delete the guided setup records before packaging my Service Graph Connector. I see the records in my machine in two place: gsw_change_log and in sys_metadata. But I cannot delete them (!?).  I tried in my app scope, and in global scope, but nothing.

I understand that without deleting them, it will ship my app with the history of the guided setup that I tested here.

2 REPLIES 2

maksimsemen
Tera Contributor

Hi, try go to gsw_change_log.list, Configure->Table next choose Application Access and change Can delete to true

 

Aditya Anand
ServiceNow Employee
ServiceNow Employee

@magicpanda You can run the fix script/background script in global scope to move these files to Global scope.

Please refer the below script for reference to move guided setup change log to global:

var gr_gsw = new GlideRecord(“gsw_change_log”);

var count =0;

gr_gsw.addEncodedQuery(“sys_scope=9c3f7a5eb12de34f8fbb02d9aa58e4c1”); // sys_id of the application

gr_gsw.setLimit(15);  //set the limit for the records

gr_gsw.query();

gs.log(gr_gsw.getRowCount());

while(gr_gsw.next()) {

gs.log('Before sys_scope - '+ gr_gsw.sys_scope.getDisplayValue() + " Record sys_id - "+gr_gsw.sys_id );

gr_gsw.sys_scope = 'global';

gr_gsw.update();

count = count+1;

gs.log('After sys_scope - '+ gr_gsw.sys_scope);

}

gs.log('Total updated files -'+ count);

 

 

Please refer the below script for reference to move guided setup status of content to global:

 

var gr_gsw = new GlideRecord(“gsw_status_of_content”);

var count =0;

gr_gsw.addEncodedQuery(“sys_scope=9c3f7a5eb12de34f8fbb02d9aa58e4c1”); // sys_id of the application

gr_gsw.setLimit(15);  //set the limit for the records

gr_gsw.query();

gs.log(gr_gsw.getRowCount());

while(gr_gsw.next()) {

gs.log('Before sys_scope - '+ gr_gsw.sys_scope.getDisplayValue() + " Record sys_id - "+gr_gsw.sys_id );

gr_gsw.sys_scope = 'global';

gr_gsw.update();

count = count+1;

gs.log('After sys_scope - '+ gr_gsw.sys_scope);

}

gs.log('Total updated files -'+ count);