- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 03:54 AM
I have taken Problem OOB. When I type in the workaround field on the problem record does not seem to hold the data , once I have saved the record, the contents disappears - there ia an entry on the audit trail but cannot see any thing in the field.
How does the 'cascade worksround' function work - again this does not seem to do anything?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 07:46 AM
It's slightly different based on the field type. This code has both ways. You can just un-comment whichever one you want to use.
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)); //Communicate last entry from journal field
incident.comments = (num + ' ' + current.work_around); //Communicate from standard string field
incident.update();
}
gs.addInfoMessage('Workaround communicated');
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 04:29 AM
What you're seeing is actually a feature of 'journal' type fields. It allows you to record multiple pieces of input over time rather than a single, static block of text. It works in the same way as the 'Additional comments' and 'Work notes' field on the incident form. Check this article out for more information.
Using Journal Fields - ServiceNow Wiki
I have seen some customers personalize the dictionary for the 'Workaround' field and change it to a 'String' type instead so that it works like a regular string field. There's no harm in doing that and you could even change it back to a journal field in the future if you wanted because both types are just strings at the DB level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 07:41 AM
I cant seem to get this communicate workaround to work.
I have redefined the workaround filed to be a string (actuall I have tried with a journal as well) and I can t get it to work as ideas?
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.u.work_around = (num + ' ' + current.work_around.getJournalEntry(1));
// incident.u_work_around = me.u_work_around;
incident.update();
}
gs.addInfoMessage('Workaround communicated');
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 07:46 AM
It's slightly different based on the field type. This code has both ways. You can just un-comment whichever one you want to use.
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)); //Communicate last entry from journal field
incident.comments = (num + ' ' + current.work_around); //Communicate from standard string field
incident.update();
}
gs.addInfoMessage('Workaround communicated');
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 08:29 AM