Knowledge Updates

rhoffecker
Giga Contributor

Does anyone know of a way to set notifications to show what is actually updated within a Knowledge Article when edits are made and published?  Currently, we only receive an email notifcation stating that there has been an update, but there is nothing that points to what actually changed.

 

Thanks!

3 REPLIES 3

SumanthDosapati
Mega Sage
Mega Sage

@rhoffecker 

You can try writing a GlideRecord script to get the previous version of the article and play around with string manipulations to print in the email.

 

Regards,

Sumanth

Wessel van Enk
Tera Guru
Tera Guru

@rhoffecker Out of the box, no you cannot. 
But like @SumanthDosapati mentions, you can write a script to compare the previous version with the current version, similar to the comparison functionality and add that into the email. 

Abhijit4
Mega Sage

Hi @rhoffecker 

 

You can create BR to get all changed field details as below.

 

var changedFields = [];
    var fields = current.getFields();
    for (var i = 0; i < fields.size(); i++) {
        var fieldName = fields.get(i).getName();
        if (current[fieldName].changes()) {
            changedFields.push({
                field: fieldName,
                oldValue: previous[fieldName].getDisplayValue(),
                newValue: current[fieldName].getDisplayValue()
            });
        }
    }

Then you can use gs.eventQueue method to trigger notification and pass these parameters as parm1 or parm2 to show later in notification body.

 

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP