BR loop when copying comments from task <-> item :no solution found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2018 06:31 AM
Hello
I need to copy all comments from task to item and vice-versa.
I’ve created 2 business rules to do so one on sc_task and one on sc_req_item.
I’m facing a problem of loop which makes the business rule copy more than one the comments on the task or item.
I’ve read plenty of posts talking about this problem and tested all solutions but none of them worked:
- User gr.setWorkflow(false)
- Compare user logged in with assigned to
- Change business rule on before/ on after
- Something like if (ritmComments.indexOf(comments)<0) {
Can anybody help me ?
On sc_req_item I have
(function executeRule(current, previous /*null when async*/) {
updateTasks();
function updateTasks() {
var sctask = new GlideRecord('sc_task');
sctask.addQuery('request_item', current.sys_id);
sctask.query();
while (sctask.next()) {
sctask.comments = 'Additonal Comment from request item : ' + current.comments;
sctask.update();}
} //endwhile
})(current, previous);
On sc_task I have
(function executeRule(current, previous /*null when async*/) {
var ritmGr = new GlideRecord('sc_req_item');
if (ritmGr.get(current.request_item)) {
ritmGr.comments = 'Additonal Comment from task : ' + current.comments.getJournalEntry(1);
ritmGr.update();
gs.addInfoMessage("Additional comments copied from task to request item"); }
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2018 06:34 AM
Copy comments from SCTask to RITM, and copy Comments from RITM to worknotes on SCTask but add a condition to check if updated by assigned to on task.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2018 06:37 AM
I have a concern about this requirement in that it's going to create a lot of "noise" on all the records involved. If you have five subtasks (and consider some of them are completed) you are updating a lot of records with that comment. That could also potentially trigger notifications - some of which are going to people are no longer involved, don't care, etc. The more notifications you make, the less people pay attention to them and then they become ineffective.
Before implementing this - really, REALLY take a strong look at the use case and how it could be used. I wouldn't want to be on the receiving end of these notifications and comments if they didn't apply to me and what I was doing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2018 06:44 AM
Yes but the main idea is to let fulfillers (working on tasks) discuss with the requester (working on items).
I've seen so many posts talking about that (even if they did not give me the right answer) that I think I'm not the only one who would like to have comments being copied from task to item and vice versa.