- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2014 08:44 AM
Anybody knows why the link Communicate Workaround in a problem, which is a UI Action that comes Out Of the Box (OOB), returns an "Undefined Value" in the incidents related to this problem instead of populating with the WorkAround field content?
According to my undestanding, I should replace current.work_around.getJournalEntry(1) with a variable defined earlier, like num and incident that are defined. But before I modify it, since it's a OOB Script, maybe there's something I'm missing. Thanks for your input.
Here the content of the OOB script of the UI Action:
current.update();
workaround();
function workaround(){
var num = current.number;
var incident = new GlideRecord("incident");
incident.addQuery("problem_id", "=", current.sys_id);
incident.addQuery("incident_state", "<", 6);
incident.query();
while (incident.next()) {
incident.comments = (num + ' ' + current.work_around.getJournalEntry(1));
incident.update();
}
gs.addInfoMessage('Workaround communicated');
action.setRedirectURL(current);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2014 05:04 AM
OK, with your help, I finally found the solution. I post it here so it may be used by someone facing a similar issue.
The reason why the script is not working in our environnement and returns a value of "undefined" is because the field work_around has been changed when we installed the Problem Management a few months ago. It's type has been changed for "STRING" instead of the default type of "JOURNAL INPUT". By doing so, the UI Action "Communicate Workaround" doesn't work because of the following line which tries to copy a journal entry:
incident.comments = ( num + ' ' + current.work_around.getJournalEntry(1));
To fix our problem, I either have to put the field type back to journal input or replace the line by this one:
incident.comments = (num + ' ' + current.work_around);
Since the field type has been change to allow the work_around to remain present in the field instead of being removed and copied in the activity logs, I'll change the script to refer to the value of current.work_around and not its journal entry.
Special thanks to Michael, Kalaiarasan and Adam who each gived me a part of the solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2014 03:15 PM
Do you have a custom state choice on your Incident? If yes, is the value of that custom choice > 6? If no, can you provide some more information?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2014 07:34 AM
Hi Michael,
We're using the default incident_state as you can see in screenshot that follows. To be sure I did compared with the Sandbox Demo.
We do use the SN Multilanguage plugin though to allow our users to work in French. It does give a translation of those choices when you work in French, but it just translate them without adding any state. I did try to "Communicate the workaround" in both languages and I get the same problem: in the problem screen, I get the message "Workaround Communicated", but in the incident it adds "PRB0010001 undefined" in the activity list. Here's two screenshot to illustrate it.
Problem PRB0010001 has INC0079942 linked to it.
When I add a comment in the Temporary Solution field of the problem and I click on the related link "Communicate Workaround", I get the message "Workaround communicated" as shown here:
Then, when I go in the Incident, I see the system added an activity with the timestamp, my name and the problem number, but instead of the workaround, it's written "undefined" as shown here:
I hope it helps understanding the problem
Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2014 07:38 AM
just to confirm , you have not checked the 'client' checkbox of ui action right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2014 07:49 AM
No, the client checkbox of the UI Action "Communicate Workaround" is not checked.