Activity feed shows "Interaction IMS#### 'Incident#' field added" — where does this sys_history_line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
When an Interaction gets linked to an Incident via interaction_related_record, the Incident's Activity feed it shows: Interaction IMS6338024 'Incident#' field added
The underlying sys_history_line looks like this:
<field>relation</field>
<type>relation</type>
<relation>Interaction IMS6338024 'Incident#' field added</relation>
<update>-1</update>
Not a real Work Notes entry - field/type = relation, update = -1 (not the usual 1/2). None of the interaction_related_record dictionary fields have audit=true, so it's not standard field auditing either.
How do I stop these lines from being added to the Work Notes activity stream?
Appreciate any pointers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Slash commands:
https://snutils.com/docs/guide/slash-commands/search-commands
✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I performed a code search for the string of: "field added" and nothing really came up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
The below is the Advanced section of a Mirror BR I created to try and troubleshoot.
(function executeRule(current, previous /*null when async*/ ) {
var interactionSysId = current.getValue("interaction");
var incidentR = current.getValue("task");
var interactionGR = new GlideRecord('interaction');
interactionGR.setValue('u_incident_number', current.getValue('task'));
interactionGR.update();
var getRelatedRecords = new GlideRecord('interaction_related_record');
getRelatedRecords.addEncodedQuery('interaction=' + interactionSysId);
getRelatedRecords.query();
while (getRelatedRecords.next()) {
//Attach KB Articles to Incident : m2m_kb_task
if (getRelatedRecords.document_table == 'kb_knowledge') {
var m2m = new GlideRecord('m2m_kb_task');
m2m.initialize();
m2m.kb_knowledge = getRelatedRecords.knowledge_article.toString();
m2m.task = incidentR;
m2m.insert();
}
var grInc = new GlideRecord('incident');
grInc.get(incidentR);
//Attach Parent Incident to Incident
if (getRelatedRecords.document_table == 'incident' && getRelatedRecords.u_parent_incident == true && !(current.u_parent_incident)) {
grInc.parent_incident = getRelatedRecords.task;
grInc.update();
} else if (getRelatedRecords.document_table == 'problem') {
//Attach Problem to Incident
grInc.problem_id = getRelatedRecords.task;
grInc.update();
}
}
})(current, previous);
The below is the original BR:
(function executeRule(current, previous /*null when async*/ ) {
var interactionSysId = current.getValue("interaction");
var incidentR = current.getValue("task");
var grInteraction = new GlideRecord('interaction');
grInteraction.addQuery('sys_id', interactionSysId);
grInteraction.setLimit(1);
grInteraction.query();
if (grInteraction.next()) {
grInteraction.setValue('u_incident_number', incidentR);
grInteraction.update();
}
var getRelatedRecords = new GlideRecord('interaction_related_record');
getRelatedRecords.addEncodedQuery('interaction=' + interactionSysId);
getRelatedRecords.query();
while (getRelatedRecords.next()) {
//Attach KB Articles to Incident : m2m_kb_task
if (getRelatedRecords.document_table == 'kb_knowledge') {
var m2m = new GlideRecord('m2m_kb_task');
m2m.initialize();
m2m.kb_knowledge = getRelatedRecords.knowledge_article.toString();
m2m.task = incidentR;
m2m.insert();
}
var grInc = new GlideRecord('incident');
grInc.get(incidentR);
//Attach Parent Incident to Incident
if (getRelatedRecords.document_table == 'incident' && getRelatedRecords.u_parent_incident == true && !(current.u_parent_incident)) {
grInc.parent_incident = getRelatedRecords.task;
grInc.update();
} else if (getRelatedRecords.document_table == 'problem') {
//Attach Problem to Incident
grInc.problem_id = getRelatedRecords.task;
grInc.update();
}
}
})(current, previous);
The mirror BR does not add the unwanted comments in the INC activity stream. I cannot tell the difference between the two. They are both running on: interaction_related_record table
