How do I make e-mail updates update Work Notes instead of Additional Comments?

kh687
Giga Contributor

Out of the box Service Now updates Additional Comments with e-mails sent into a ticket. This means they are sent to the customer. I want to stop this by getting e-mails added as Work Notes instead. How do I go about doing this?

1 ACCEPTED SOLUTION

harshvardhan_11
Giga Expert

As per my understanding, you want to update worknotes with the mail body received by service now.



There must be a inbound email for your table. E.g Update Incident (BP) for incident table.



The inbound script will have a line something like


current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;




You can comment that line and write a new line


current.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;



This will update worknotes instaed of additional comments.



Note: Make sure which inbound script is running for your table. Also if the inbound script is updating worknotes somewhere else in script, you have to comment it, or append all the worknotes together.


View solution in original post

7 REPLIES 7

Hi Kim,



This will update both the worknotes and comments for specific sender. You can put the gr.comment section in else condition. So that if sender is as per the requirement, only worknotes will be updated. In all other cases comments will be updated.  



Something like this



if (email.from().indexOf("@redacted.com")){


  gr.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;


  }


else


{


gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;


}



  if (email.subject.toLowerCase().indexOf("please reopen") >= 0)


  gr = new Incident().reopen(gr, email) || gr;


simonw
Tera Expert

Hi Ken,



You may also have your e-mail notification for the incident.commented event set to send to the event creator.   This means that if you update the incident you get a notification back to say you've done something which can be a bit excessive.   If you uncheck this checkbox it will mean the notification only sends when the incident is updated by somebody else



Kind regards,



Simon


Jyoti36
Mega Expert

Hi Harsh,



Thanks for your reply!


I have accomplished this already. Thanks for your time again!



Cheers!