- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 01:03 PM
I have a 3rd party Integration that writes to custom fields in Incident Management. I then have BRs that monitor those fields and make appropriate adjustments to the (native) Incident fields, based on our internal requirements. Most work very well.
One such rule, however, is set up to monitor the 3rd Party's "Status", and when they set to "Closed", we set our Incident to "Resolved". Is is configured to run After Update, and is the highest Order number for the Incident Table running After update.
I have a log message to verify the script is activating within seconds of the 3rd Party updating the monitored field, but the other fields I'm attempting to change with the BR are not updating.
If I use the same statements in a Background Script interactively, the Incidents update normally, although I do receive some alerts on other slow business rules). While I know how to turn on BR Debugging, it doesn't seem like I would receive any information from this because I'm not the one updating the Incident record. How do I catch whatever is going wrong when the BR attempts to set these field values (after the fact).
Business Rule Script:
(function executeRule(current, previous /*null when async*/) {
gs.info('Business rule ********** started for Incident ' + current.number);
current.state = 6;
current.closed_at = current.u_custom_closed_date;
current.u_actual_resolution = current.u_custom_closed_date;
current.close_notes = 'Closed by Custom NOC';
current.u_major_system = 'Network';
current.u_category = 'Network System Issues';
})(current, previous);
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 01:43 PM
The reason I asked this question is because, you will have to switch the BR to Before business rule. Changes made in before Business Rules are automatically saved when all before Business Rules are complete, and after Business Rules are best used for updating related, not current, objects
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 03:35 PM
That was added when the state wasn't changing as I desperately sought out what I expected to be a mandatory field stopping me from updating State. I've commented it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 03:36 PM
Now that makes sense. I'm trying that now. So, if there had been an error, would it have shown up in the System Log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 07:35 AM
Yes, an error should have shown up in the logs.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 01:43 PM
The reason I asked this question is because, you will have to switch the BR to Before business rule. Changes made in before Business Rules are automatically saved when all before Business Rules are complete, and after Business Rules are best used for updating related, not current, objects
Thanks,
Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2018 01:27 PM
Do you have any other business rules or data policies configured that require 'state' to be mandatory before updating the record? What happens to the record if you remove (or comment out) the line that contains current.state = 6?