- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 03:13 AM
Hi All,
Disable additional comments notification for ritm when added sctask comments Added. I have written business rule script to copy sc task comments in Ritm its working fine. Now my requirement while coping sctask comments to ritm no need to send ritm notification to users . Please help me on this.
Thanks,
Suresh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 05:33 AM
Hi,
are you saying you don't want email only when the comments are copied from sc_task to RITM but require when normal comments are added?
I believe for copying you must have done GlideRecord update on RITM.
In that you can use setWorkflow(false) to disable notification.
Note: Using setWorkflow(false) will block all BRs from running on update of RITM
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 05:25 AM
Hi Suresh,
Can you share the Business Rule once? I would suggest you adding a keyword that will help differentiate. Share the script so that it can be modified a bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:38 AM
Hi Singh,
Business rule:
(function executeRule(current, previous /*null when async*/ ) {
var compare, task_comment2, task_comment, ritm_comment2, ritm_comment;
task_comment = current.comments.getJournalEntry(1);
//Remove timestamp and name from additional comment
var regex = new RegExp('\n');
var i = task_comment.search(regex);
if (i > 0) {
task_comment2 = task_comment.substring(i + 1, task_comment.length);
}
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);
//Remove timestamp and name from additional comment
var i1 = ritm_comment.search(regex);
if (i1 > 0) {
ritm_comment2 = ritm_comment.substring(i1 + 1, ritm_comment.length);
}
compare = task_comment2.indexOf(ritm_comment2);
if (compare == -1) // If No match found
{
ritm_gr.comments = "ScTask Comments for " + current.number + " : " + task_comment2.trim();
ritm_gr.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 05:33 AM
Hi,
are you saying you don't want email only when the comments are copied from sc_task to RITM but require when normal comments are added?
I believe for copying you must have done GlideRecord update on RITM.
In that you can use setWorkflow(false) to disable notification.
Note: Using setWorkflow(false) will block all BRs from running on update of RITM
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 06:31 AM
Hi Ankur,
By using setWorkflow(false); its working fine , But I have Issue on setWorkflow(false); additional has not coping from sctask to Ritm .
Additional Comments are has to copy and email has not to trigger while coping the comments.