ATF - unable to edit Copied From field on test form


Description

Field "Copied from" on the ATF test form is read only and cannot be edited

Instructions

The column sys_atf_test.copied_from is defined as read only on the base system 

>> https://<instancename>.service-now.com/sys_dictionary_list.do?sysparm_query=element%3Dcopied_from%5Ename%3Dsys_atf_test&sysparm_view=advanced

 

The copied from field , functionality is defined on the following documentation link

https://docs.servicenow.com/bundle/rome-application-development/page/administer/auto-test-framework/concept/quick-start-tests.html

"When you copy a test, Automated Test Framework populates the Copied from field with the name of the copied test. When an upgrade changes a quick start test Automated Test Framework notifies test designers about the change in a notification on the test form. Test designers can revert the copied test to the upgraded version with the Revert Copy to Base System UI action."

 

If still need to edit the field on a particular test record , the following code can be used as a reference

 

var gr_atf = new GlideRecord("sys_atf_test");
gr_atf.addQuery('sys_id','f940c9091b5af410cd3f6429274bcb02');
gr_atf.query();
if(gr_atf.next()){
  gr_atf.copied_from = '';
  gr_atf.update();
}

 

Additional Information

https://docs.servicenow.com/bundle/rome-application-development/page/administer/auto-test-framework/concept/quick-start-tests.html