- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 08:14 AM
Hello Everyone,
I have a business scenario where if i create an incident in InstanceA, it should create an incident in InstanceB. Also, any updates made to an incident in InstanceA should also reflect in InstanceB. I have configured a REST message and also a Business Rule. The problem is, i have used current.update() at the end of my BR and its causing performance issues while executing insert/update actions. Is there any alternative to this method to achieve back my performance?
Below is my BR
(function executeRule(current, previous) {
var r = new sn_ws.RESTMessageV2('ABC to MSP Rest Message ', 'ABC to MSP');
r.setStringParameterNoEscape('u_short_description', current.short_description);
r.setStringParameterNoEscape('u_impact', current.impact);
r.setStringParameterNoEscape('u_configuration_item', current.cmdb_ci);
r.setStringParameterNoEscape('u_incnumber_abc', current.number);
r.setStringParameterNoEscape('u_subcategory', current.subcategory);
r.setStringParameterNoEscape('u_caller', current.caller_id);
r.setStringParameterNoEscape('u_sysid_abc', current.sys_id);
r.setStringParameterNoEscape('u_urgency', current.urgency);
r.setStringParameterNoEscape('u_category', current.category);
r.setStringParameterNoEscape('u_description', current.description);
var response = r.execute();
var responseBody = response.getBody();
var parsed_response=JSON.parse(responseBody);
var id =parsed_response.result[0].sys_id;
var id1 =parsed_response.result[0].display_value;
current.u_msp_incident_sysid = id;
current.u_msp_incident_number = id1;
current.update();
var httpStatus = response.getStatusCode();
Solved! Go to Solution.