Syncing additional comments, duplicate issue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 09:13 AM
Hey Everyone,
I have 2 business rules.
Both are onBefore when at update when additional comments changes.
We have a Global business rule on the incident table. Code is below:
(function executeRule(current, previous /*null when async*/ ) {
var cs = new GlideRecord('x_g_cfd_elims_cases');
cs.addQuery('incident', current.sys_id);
cs.query();
while (cs.next()) {
cs.comments = current.comments;
cs.update();
}
// Add your code here
})(current, previous);
We have another business rule on the scope app ELIMS Integration, table extends from case.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', current.incident.sys_id);
inc.query();
while (inc.next()) {
inc.comments = current.comments;
inc.update();
}
})(current, previous);
We added gs.getSession().isInteractive(); to the condition of the both business rules, but when a user from either the incident or case comments in additional comments, you will get a duplicate comment. Any suggestions? I can't seem to find a concrete resolution on community board.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 11:24 AM - edited 06-02-2023 11:26 AM
Hi @Community Alums
Chek out this link How would I prevent a Business Rule from running twice this might be useful.