- 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 04:28 PM
If you want to drive your incident field values from external integration, then you should handle this in your transform scripts.
what's integration mechanism for this integration? is it REST, web service, scripted web service?
After BR is not good idea in this case of integration.
We have many integrations with similar use case like yours .
we handle this in util ( script include) and this script include is called from transform script.
We have implemented generic REST API for all integrations so that they can send same payload.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2018 05:19 AM
Most of mine aren't After Rules, but this particular one was a "cleanup" that required no response back to the vendor, so I didn't want to delay the integration longer than necessary. Changing to Before does seem to have resolved the issue.