PrashantLearnIT
Tera Sage

I have explained how to Copy Work notes from Requested Items to Catalog Tasks using Business Rules.

If you have any feedback related to the scripting part, please write it in the comment box.

====================BUSINESS RULES======================

Table - Requested Item
When to Run - Asynch and on Update
Condition - Worknotes Changes
Scripts - 
(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var sc_task = new GlideRecord('sc_task');
    sc_task.addQuery('parent', current.getUniqueValue());
    sc_task.query();
    while (sc_task.next()) {
        sc_task.work_notes = current.work_notes.getJournalEntry(1);
        sc_task.update();
    }
})(current, previous);

 

Best Regards,

Prashant

If my article helped you in any way, please mark this as helpful and make this a bookmark.

Version history
Last update:
‎08-05-2022 12:45 AM
Updated by: