Creating a report that tracks changes in knowledge article content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
A simple option would be to use an empty metric definition, and trigger it via a business rule
- 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.
- 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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Thank you for the suggestion! Just to clarify, the "definition gliderecord here" means the reference to the metric created before, right?
Also, what is a glide record in this context?
var metric = new global.MetricInstance('definition gliderecord here' , current)
