Work Notes Updating 3 times in a Row under RITM

John Vo1
Tera Guru

Can someone help me out and see when someone updates the work notes and changes the state it updates the RITM 3 times in a row.

find_real_file.png

I open a ticket with SN and they told me it was a business rule I created called Work Notes to RITM.   Can someone take a look at this business rule and see what's causing the work notes to update more than once on a RITM

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Here is a snapshot of our business rule, running on sc_task to push worknotes to the RITM:



find_real_file.png



find_real_file.png



We have nothing set on the "Actions" tab. Hope that helps. I just tested this rule and it's working in our instance.


View solution in original post

17 REPLIES 17

I don't think you need to copy my code exactly. I would suggest these changes to yours:



Change "when" to after


Only check off "update"


Add filter condition: work notes changes


Then update your script to


var gr = new GlideRecord('sc_req_item');


  gr.get(current.request_item);


  gr.work_notes = current.work_notes;


  gr.update();


Only check off "update" - does this means only update is check and not insert.


That's how ours is set up, since typically the creation of a ticket doesn't include comments or work notes, so you only need to run the business rule when the task is updated and the work notes change on that update.


I updated to what you told me and work notes still not showing up under RITM when TASK is updated.


find_real_file.png


find_real_file.png


You'll want to do the gliderecord query within the default function:\


(function executeRule(current, previous /*null when async*/) {


var gr = new GlideRecord('sc_req_item');


  gr.get(current.request_item);


  gr.work_notes = current.work_notes;


  gr.update();


})(current, previous);