Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2019 07:16 AM
I tried this and added a log statement to see what had changed. I went to a Problem Task and update about 3 fields, but the only thing that was logged was the sys_updated_on field.
(function executeRule(current, previous /*null when async*/) {
var changeFields;
var gr = new GlideRecord('problem');
gr.addQuery('sys_id', current.problem);
gr.query();
if (gr.next()) {
for (var x in current){
if (current[x] != previous[x]) {
gs.log('Field: ' + x);
changedFields += 'Field ' + x + ' has changed on record ' + current.number + ' from ' + previous[x] + ' to ' + current[x] + '\n';
}
}
gr.work_notes = changedFields;
gr.update();
}
})(current, previous);