- 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-16-2018 02:16 PM
Create an after business rule on sc_task table
When: after insert and update
Conditions: Additional comments changes
Script:
var gr= new GlideRecord("sc_req_item");
gr.get(current.getValue("request_item"));
gr.<field name on request item>=current.comments.getJournalEntry(1);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:19 PM
Could you write it a bit more specific ? Its not from RITM table and its not additional comments but close notes from task to request?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 10:55 PM
Thanks alot for the reply. I tried the above rule but somehow nothing happens. WHen I try to debug i see that it runs rule "