
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2021 04:13 AM
Hi,
i have a br which copies the additional comments from ritm to incident.
i have a another br which copies additional comment from incident to ritm.
now the issue is because there are two business rules if i strt commenting ritm it copies to incident but the 2nd business rule again copies the same to incident.Now how to restrict i need both the br because the requirement is 2 way.
Regards,
Debasis
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2021 02:00 AM
Hi,
update as this
br on incident table--after -update
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.u_request_item);
ritm.query();
if (ritm.next() ) {
var curWN = current.work_notes.getJournalEntry(1);
if(ritm.work_notes.getJournalEntry(1) == '' || curWN.indexOf(ritm.work_notes.getJournalEntry(1)) <0){
ritm.comments = current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
ritm.update();
}
}
br on ritm table
var inc = new GlideRecord('incident');
inc.addQuery('u_request_item', current.sys_id);
inc.query();
if (inc.next() ) {
gs.addInfoMessage("inside from ritm");
var curWN = current.work_notes.getJournalEntry(1);
if(inc.work_notes.getJournalEntry(1) == '' || curWN.indexOf(inc.work_notes.getJournalEntry(1)) <0){
inc.comments = current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
inc.update();
}
}
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
‎08-13-2021 04:21 AM
Hi,
You can append the ticket number while copying the comment.
After this you can check in the BR, latest comment that you want to copy should not contain the ticket initials like INC or RITM or any specific keyword.
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
Regards,
Saurabh
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2021 04:22 AM
In BR condition use
gs.isInteractive()
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0719429#:~:text=The%20isInteractive()%20method%20checks,using%20the%20log%2Din%20screen.&text=However%2C%20this%20method%20always%20returns,in%20using%20ServiceNow%20mobile%20application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2021 04:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2021 10:08 PM
you can refer this for the solution
solution from Sravani
Sync'ing RITM and SCTASK work notes \ additional comments
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
‎08-16-2021 01:09 AM
Hui Ankur
the below i have tried but this is also not working.
br on incident table--after -update
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.u_request_item);
ritm.query();
if (ritm.next() ) {
gs.addInfoMessage("inside from incident"+current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n"));
ritm.comments = current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
// ritm.work_notes = current.work_notes.getJournalEntry(1).match(/\n.*/gm).join("\n");
ritm.update();
}
br on ritm table
var inc = new GlideRecord('incident');
inc.addQuery('u_request_item', current.sys_id);
inc.query();
if (inc.next() ) {
gs.addInfoMessage("inside from ritm");
inc.comments = current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n");
//inc.work_notes = current.work_notes.getJournalEntry(1).match(/\n.*/gm).join("\n");
inc.update();
}
but thee issue is not fixed can u guide what i need to change to achieve this?
Regards,
Debasis