Business Rules in ServiceNow would be helpful to enable event based sync in ConnectALL. This approach eliminates the need of polling ServiceNow for changes. A custom Business Rule can trigger the sync using PUSH interface in ConnectALL.
Step-by-step guide
- Navigate to System Definition > Business Rules
- Click New to create a new business rule
- Enter the following fields
Name - name of the business rule
Table - select incident
Advanced - tick this check box
When - async
Insert - tick this check box
Update - tick this check box Go to Advanced section and add the following code snippet in the script box
function onAsync(current) {
var restMessage = new sn_ws.RESTMessageV2();
restMessage.setHttpMethod("post");
restMessage.setEndpoint("http://connectall:7070/SyncService/push?apikey=<your-api-key>");
restMessage.setRequestBody("{\"appLinkName\" : \"ServiceNow2Jira\", \"origin\" : \"source\", \"id\" : \""+current.sys_id+"\"}");
var response = restMessage.execute();
}
JS
Please refer our ReST API guide for more details. It is available here.
Note: Push service is running on default port of 7070(http://connectall:7070/SyncService/push). Please make sure you make this url accessible from your ServiceNow instance. Reverse proxy would be a best option to make this service accessible from ServiceNow.