ServiceNow Integration
Integration of AIR with ServiceNow is possible via the feature called "Business Rules".
Steps to Integrate
Step 1: Create a Trigger for ServiceNow
Step 2: Creating the Integration Settings in ServiceNow
(function executeRule(current, previous /*null when async*/) { try { var r = new sn_ws.RESTMessageV2(); // paste related webhook url below var airwebhookurl = "<insert webhook URL>"; //defining the hostname of endpoint or ip var endpointIP = current.getValue("hostname"); r.setRequestHeader("Content-Type","application/json"); r.setHttpMethod("post"); r.setStringParameter("baseUrl",airwebhookurl); var obj = { "endpoint": endpointIP }; var body = JSON.stringify(obj); r.setRequestBody(body); var response = r.execute(); var httpStatus = response.getStatusCode(); if(httpStatus==200) { gs.info("Webhook target HTTP status response: " + httpStatus); return httpStatus; } else { gs.log(response.getErrorCode()+"---"+response.getErrorMessage()); return httpStatus; } } catch (ex) { var message = ex.message; gs.error("Error message: " + message); } gs.info("Webhook target HTTP status response: " + httpStatus); })(current, previous);
Step 3: Testing the business rule.
Last updated
Was this helpful?

