Let's understand what actually happens when a user clicks the Communicate Workaround UI action (or form link) on the Problem record form. Before getting into that, there are two prerequisites worth noting: the button only appears if the Workaround field on the current Problem record is not empty, and the Duplicate Of field — which can reference another Problem record — must be empty.
Communicate Workaround UI Action Click
Now that we understand when the Communicate Workaround UI Action appears on the Problem form, let's look at what happens when it's actually clicked. The out-of-box script behind this UI Action shows that ServiceNow first updates two fields on the Problem record — workaround_communicated_at and workaround_communicated_by — with the current date/time and the logged-in user's ID, respectively.
function onCommunicateWorkaround() {
if (g_form.modified) {
getMessage("You have unsaved changes. Please save them to continue", function(msg) {
g_form.addErrorMessage(msg);
});
return false;
}
g_form.submit('communicate_workaround_new');
}
if (typeof window == "undefined")
communicateWorkaround(current);
function communicateWorkaround(current) {
action.setRedirectURL(current);
var time = new GlideDateTime();
current.workaround_communicated_at = time;
current.workaround_communicated_by = gs.getUserID();
current.update();
gs.eventQueue('communicate.workaround', current, current.workaround);
gs.addInfoMessage(gs.getMessage('Workaround communicated'));
}
At the same time, the system triggers an event named communicate.workaround. This event fires two Script Actions: Copy Prb workaround to Inc comments and Copy Prb workaround to Inc work notes. These update the Comments and Work Notes journal fields, respectively, on the Incident records mapped to the current Problem record.
Script Action: Copy Prb Workaround to Inc Work Notes
This updates any mapped Incident whose state is not Resolved — meaning the Incident is still active. It writes the Problem number and workaround details into the Incident's Work Notes field.
var work_notes = "[code]" + event.parm1 + "[/code]";
var incident = new GlideRecord('incident');
incident.addQuery('problem_id', current.getUniqueValue());
incident.addQuery("incident_state", '<', IncidentState.RESOLVED);
incident.query();
while (incident.next()) {
incident.work_notes.setJournalEntry(current.number + ' ' + work_notes);
incident.update();
}
Script Action: Copy Prb Workaround to Inc Comments
Similar logic applies here, but this script action updates Incident Comments instead, filtered to Incidents where the state is Resolved and the close code is Known Error.
var CLOSE_CODE_KNOWN_ERROR = "Known error";
var comments = "[code]" + event.parm1 + "[/code]";
var incident = new GlideRecord('incident');
incident.addQuery('problem_id', current.getUniqueValue());
incident.addQuery('state', IncidentState.RESOLVED);
incident.addQuery('close_code', CLOSE_CODE_KNOWN_ERROR);
incident.query();
while (incident.next()) {
incident.comments.setJournalEntry(current.getDisplayValue() + ' ' + comments);
incident.update();
}
In short: when a user clicks the Communicate Workaround UI action on the Problem form, ServiceNow updates the Work Notes field on any mapped open Incidents, and the Comments field on any mapped closed Incidents with a Known Error close code.