- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 08:21 AM
Can someone help me out and see when someone updates the work notes and changes the state it updates the RITM 3 times in a row.
I open a ticket with SN and they told me it was a business rule I created called Work Notes to RITM. Can someone take a look at this business rule and see what's causing the work notes to update more than once on a RITM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2017 11:02 AM
Here is a snapshot of our business rule, running on sc_task to push worknotes to the RITM:
We have nothing set on the "Actions" tab. Hope that helps. I just tested this rule and it's working in our instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 10:00 AM
I would change it from an after to a before and remove the ritm.update() line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 10:52 AM
When I do that the RITM work notes are not getting updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 10:57 AM
Ah, apologies - I misread what you were attempting to do. We are pushing comments to our ritms from the tasks, this is the script I put into place:
Condition to run: additional comments changes
When to run: before update
Script: (We copy up to the ritm and then down to the task, so I preface the comment with the source so I know which to copy, so I don't end up with an infinite loop):
(function executeRule(current, previous /*null when async*/) {
str = current.comments;
var pos = str.search('Update from Requested Item');
if(pos == -1){
gs.info('The push from Task to RITM will trigger now: ' + current.comments);
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.comments = 'Update from Task "' + current.short_description + '": ' + current.comments;
gr.update();
}
else{
gs.info('I will not push this comment from Task to RITM: ' + current.comments);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2017 11:07 AM
So am I suppose to replace my current script with the one you provided? If task work notes gets updated with it copy it to RITM?
Thanks,
John
