Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Creating a report that tracks changes in knowledge article content

MatissK
Kilo Explorer

Hi,

First time poster, long time lurker, as they say... 

Is there a way to create a report that tracks which articles have not had any changes to content made, when "Valid to" date is updated?

 

My company wants to keep track of which articles are simply updated with a new "Valid to" date but the content is kept unchanged.

Is this possible?

1 REPLY 1

Kieran Anson
Kilo Patron

A simple option would be to use an empty metric definition, and trigger it via a business rule

 

  1. Create a metric definition. This is effectively a placeholder record for reporting purposes, it won't be triggered by the usual metric processing engine as that only runs on task extended tables by default.

KieranAnson_0-1762180640331.png

 

  1. Create an after BR that'll update the metric. The BR should have a filter condition to only update if the valid to field changes. In the scripted condition you can add the following
!current.text.changes()
(function executeRule(current, previous /*null when async*/) {

	var metric = new global.MetricInstance('definition gliderecord here' , current)

	if(!metric.metricExists()){
		var metricGR = metric.getNewRecord();
		metricGR.setValue('value', 1); //first metric
		metricGR.update();
	} else {
		//get the existing metric and increment 
		var metricUpdateGR = new GlideRecord('metric_instance');
        metricUpdateGR.addQuery("id", current.getUniqueValue());
        metricUpdateGR.addQuery("definition", 'sys_id_of_definition_record');
		metricUpdateGR.setLimit(1);
		metricUpdateGR.query();
		if(metricUpdateGR.next()){
			currentValue = Number(metricUpdateGR.getValue('value'))
			metricUpdateGR.setValue('value' , currentValue ++);
			metricUpdateGR.update();
		}
	}

})(current, previous);