How to remove name and Date and Time stamp from additional comments

Jay Geguj
Kilo Contributor

Hello everyone

I am using below script to copy additional comments from catalog task to requested item.

(function executeRule(current, previous /*null when async*/) {
var compare,task_comment2,task_comment,ritm_comment2,ritm_comment;
task_comment =current.comments.getJournalEntry(1);
var ritm_gr = new GlideRecord('sc_req_item');
ritm_gr.addQuery('sys_id', current.parent);
ritm_gr.query();
if(ritm_gr.next())
{
ritm_comment =ritm_gr.comments.getJournalEntry(1);
compare = task_comment2.indexOf(ritm_comment2);
if(compare == -1)
{
ritm_gr.comments = task_comment2.trim();
ritm_gr.update();
}
}
})(current, previous);

 

The problem is 'This script is executing as expected but It is copying timestamp also'

I don't want timestamp to copy from catalog task to request item form.

Please help me to achieve this.

Thank you

1 ACCEPTED SOLUTION
2 REPLIES 2

Prasad Dhumal
Mega Sage
Mega Sage

Hello Jay

Remove User info and timestamp from commets - Developer Community - Question - ServiceNow Community

Please follow above link and refer solution from Deepak

Jay Geguj
Kilo Contributor

Solution worked

Thank you