- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:12 PM
I have had some trouble making an BR that copies close notes from SC Task to request table (preferly it only adds info and not delete if field allready has txt in it )... Problem is i dont see what the error is...
Please check screenshots
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2018 12:12 PM
You should be able to do this with a single 'After' 'Update' business rule on the 'sc_task' table. The business rule should run when the Close notes field changes and the Close notes field is not empty. Here is the script...
(function executeRule(current, previous /*null when async*/) {
// Query for the Request parent
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request_item.request);
req.query();
if (req.next()) {
// Add current close notes to request close notes
req.close_notes = req.close_notes + '\n' + 'Close notes added from ' + current.number + ':\n' + current.close_notes + '\n';
req.update();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2018 12:12 PM
You should be able to do this with a single 'After' 'Update' business rule on the 'sc_task' table. The business rule should run when the Close notes field changes and the Close notes field is not empty. Here is the script...
(function executeRule(current, previous /*null when async*/) {
// Query for the Request parent
var req = new GlideRecord('sc_request');
req.addQuery('sys_id', current.request_item.request);
req.query();
if (req.next()) {
// Add current close notes to request close notes
req.close_notes = req.close_notes + '\n' + 'Close notes added from ' + current.number + ':\n' + current.close_notes + '\n';
req.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2018 12:35 PM
@Mark Stanger
Thanks for attempt... But it still doesnt copy anything. Not to RITM / REQ. How do i figure out whats wrong when i turn on debug i get this " 21:32:39.975: Global ==> 'Copy closenotes Task - RITM - REQ' on sc_task:SCTASK0022936" So it is like it runs the rule but nothing really happens....
Any suggestions ?
I also tried to change condition to run only when close notes changes result = nothing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2018 12:37 PM
Nevermind got your rule to work Mark. THANX everyone!