Loading demo data in the Data Certification plugin causes sys_triggers to be created and the demo data instances incorrectly use the script new CertificationTaskCreate().runCerts();. When the triggers for these demo data instances run, it will unexpectedly cause the schedules to run, which will in turn create more instances and tasks.

Steps to Reproduce


  1. Install the Data Certification plugin with demo data.

    For more information, see the documentation topic Activate a plugin.

  2. Note the number of certification tasks.

  3. In a background script, run the following code

    var current = new GlideRecord('cert_instance');
    current.get('bb4530139791300000f8d7b8fa297535'); //this is the sys_id of one of the demo data records
    new CertificationTaskCreate().runCerts();

    This will replicate the behavior that happens when the Schedule [sys_trigger] records that are associated with certification instances run.

  4. Look at the number of certification tasks and note that there are now more tasks. Triggers against certification instances should not cause more tasks to be created.

  5. Run the Verify User Lenovo Computers schedule and wait for all of the tasks to generate.

    Note the total number of certification tasks.

  6. Copy the sys ID from the new instance that is created.

  7. In a background script, run the following code, replacing PASTE_CERT_INSTANCE_SYS_ID_HERE with the copied sys ID

    var current = new GlideRecord('cert_instance');
    new CertificationTaskCreate().runCerts();

    Look at the number of certification tasks. Notice that no new additional cert tasks were created. This is the expected and desired behavior.



For every undesired certification schedule:

  1. Load the attached update set into your instance. This update set makes a change to the CertificationTaskCreate Script Include. It will add the following if statement to the beginning of the runCerts function:

     if (this.certDef.getTableName() == 'cert_instance')

    This will prevent any Schedule [sys_triggers] that are associated with certification instances from running, regardless of whether they are demo data or user-generated.

  2. This issue only happens if there are left over certification instances from the demo data. If you would like to remove the demo data, run the following script in a background script, replacing PASTE_SCHEDULE_SYS_ID_HERE with the sys_id of the demo data schedule that you would like to remove. 


    function cleanUpData(certScheduleId) {
    	if (!certScheduleId)
    	var instance = new GlideRecord('cert_instance');
    	instance.addQuery('cert_schedule', certScheduleId);
    	while(instance.next()) {
    		var task = new GlideRecord('cert_task');
    		task.addQuery('cert_instance', instance.sys_id + '');
    		while(task.next()) {
    			var taskId = task.sys_id;
    			var certEl = new GlideRecord('cert_element');
    			certEl.addQuery('cert_task', taskId);
    			while(certEl.next()) {
    				certEl.follow_on_task = '';
    		var trigger = new GlideRecord('sys_trigger');
    		trigger.addQuery('job_context', 'CONTAINS', 'fcDocumentClass=cert_instance');
    		trigger.addQuery('job_context', 'CONTAINS', 'fcDocumentKey=' + instance.sys_id);
    	var trig = new GlideRecord('sys_trigger');
    	trig.addQuery('job_context', 'CONTAINS', 'fcDocumentClass=cert_schedule');
    	trig.addQuery('job_context', 'CONTAINS', 'fcDocumentKey=' + certScheduleId);
    	var certSchedule = new GlideRecord('cert_schedule');


Related Problem: PRB1171743

Seen In

Fuji Patch 12 Hot Fix 1
Fuji Patch 9
Geneva Patch 4

Intended Fix Version


Fixed In

Istanbul Patch 11
Jakarta Patch 5

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-26 07:36:30