sc_task Additional Comments

nyrguy45
Kilo Contributor

Hello All,

I am having issues with "Additional Comments" not being emailed to the Requestor of the task from SC_task

I am new to ServiceNow so not sure as to where to begin looking.

Any help would be highly appreciated.

 

Best,

 

1 ACCEPTED SOLUTION

JR Guieb
Tera Expert

Here is what I did for my company because we had the same requirement.

 

First what I had to do is to create an email notification that will send to the requester whenever Additional Comments are entered into the RITM.

 

Next I created a business rule that will copy the Additional Comments from the catalog task and place them into the RITM. Here is what I did for the business rule:

  • Table = Catalog Task [sc_task]
  • Check Advanced
  • When to run
    • When = Before
    • Update = checked

find_real_file.png

  • Advanced
    • Condition
      • current.comments.changes()
    • var gr = new GlideRecord('sc_req_item');
      gr.get(current.request_item);
      gr.comments = current.comments;
      //gr.work_notes = current.work_notes;
      gr.update();

find_real_file.png

Now when an additional comment is added at the catalog task it will get copied into the RITM, and because there is an email notification setup to send to the requester when an additional comment is added to the RITM the email to the requester will send.  

View solution in original post

17 REPLIES 17

the requested_for filed is at the request level so it is current.request.requested_for.  Any you want to keep it as != as the end user does not have access to view the task.  This is there so that if you user my other business rule that I provided that copies the end users comments on the RITM to the task it will then not copy them back up to the RITM.

Can you confirm your account is not the requested for. This script it so that ITIL workers comments are copied to the RITM and in conduction with the business rule I gave you to copy comments from the user on the RIMT to the task so it does not get suck in an in a loop copying from RITM to task or task to RITM multiple times.

reginabautista
Kilo Sage

Hi please try the following. I've tested this and working perfectly in my instance

 

(function executeRule(current, previous /*null when async*/) {
var curUser = gs.getUserID();
var req_for = current.opened_by;

if (curUser==req_for){
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('number=' + current.request_item.getDisplayValue());
gr.query();
while(gr.next()){

gr.comments = current.comments;
gr.work_notes = current.work_notes;
gr.update();
}
}

})(current, previous);

JR Guieb
Tera Expert

Here is what I did for my company because we had the same requirement.

 

First what I had to do is to create an email notification that will send to the requester whenever Additional Comments are entered into the RITM.

 

Next I created a business rule that will copy the Additional Comments from the catalog task and place them into the RITM. Here is what I did for the business rule:

  • Table = Catalog Task [sc_task]
  • Check Advanced
  • When to run
    • When = Before
    • Update = checked

find_real_file.png

  • Advanced
    • Condition
      • current.comments.changes()
    • var gr = new GlideRecord('sc_req_item');
      gr.get(current.request_item);
      gr.comments = current.comments;
      //gr.work_notes = current.work_notes;
      gr.update();

find_real_file.png

Now when an additional comment is added at the catalog task it will get copied into the RITM, and because there is an email notification setup to send to the requester when an additional comment is added to the RITM the email to the requester will send.  

Hey i know this was awhile ago but how did you handle the end user responding to these comments?