Notifications

31 views

Description

It is not possible to create an Email Notification on creation of Outbound HTTP logs


In the backend code "setRunEngines(false)" is set on the sys_outbound_http_log class.


What this means is that things like business rules and notifications will not be evaluated on this table.

Due to performance and security reasons, we do not want business rules/notifications running on sys_outbound_http_log that are triggered through rest/soap messages

Instructions

Possible work arounds:




1) As a work around you can send a notification manually after the outbound web service script based on a specific response code:


For example:


******************************



var restMessage = new sn_ws.RESTMessageV2();

restMessage.setBasicAuth('<username>', '<password>');

restMessage.setHttpMethod("post");

restMessage.setEndpoint("https://<instance>.service-now.com/api/now/table/incident");

restMessage.setRequestBody("{\"short_description\" : \"Test incident from Recordless RESTMessageV2 \",\"caller_id\" : \"Abel Tuter\"}");


var response = restMessage.execute();

var httpStatus = response.getStatusCode();

gs.log(httpStatus);



if(httpStatus=='201'){

var mail = new GlideEmailOutbound();

mail.setFrom('<instance>@service-now.com');

mail.addRecipient('<from>@<address>');

mail.setSubject('status code 201');

mail.setBody('status code 201');

mail.save();

}



******************************


PS: This code is a customized code and a possible work around . Customization is beyond the scope of support .




2)  schedule job to query periodically this table and do the needful ( create event etc )

Article Information

Last Updated:2020-07-23 11:59:35
Published:2020-07-23