How can you benefit from using the Business Rules?
Here is a brief explanation of what business rules in Businessmap can do. Also, the same mechanism for automation is available in ServiceNow, called business rules as well.
The basic concept is that you have a web automation mechanism that allows you to connect 3rd party web applications and services to each other. The business rules pair a trigger with some conditions to one or multiple actions. Whenever the trigger event occurs, and the conditions are met, the rule automatically completes the actions for you. What makes using the business rules great is that you don’t need to be a developer to make such automation, anyone can do it!
Note: However, for the following integration, as Web Service method calls are invoked using the APIs of both systems, some software engineering experience, and background is required!
How can I set up an integration between Businessmap and ServiceNow?
ServiceNow to Businessmap
The scope of the integration could be to link, for example, a record in ServiceNow (incident, issue, task, etc.) to a Businessmap Card. Further cases like status updates, adding comments, or other scenarios could be covered.
From the Record Table in ServiceNow, a business rule is created from the context menu.
Inside the business rule, the first step would be to specify the TRIGGER, i.e. when to run the business rule. In the conditions section, you can define any special cases.
In the example below, the rule will be triggered only if the Title/Short Description of the Incident starts with "KBZ".
The last and most important and complex step is the action of the business rule. Calling the Businessmap API to create and link the card there.
Note: As this is a 3rd party web call, the Advanced Tab of the business rule is used.
Here is a snippet you can copy and paste in the business rule. This one creates a card in Businessmap, copying only the Short and Long description of the incident.
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://your_account_subdomain.kanbanize.com/api/v2/cards');
request.setHttpMethod('POST');
request.setRequestHeader('Content-Type','application/json');
request.setRequestHeader('apikey','place your apikey here');
request.setRequestBody('{"column_id": 15369,
"lane_id": 4699,
"title": "'+current.short_description+'",
"description":"'+current.description+'",
"custom_id":"'+current.sys_id+'",
"exceeding_reason": "just in case"}');
var response = request.execute();
current.work_notes = response.getBody();
current.update();
IMPORTANT: For the code to work, you need to make sure the following is properly set.
- The endpoint URL has your Businessmap account subdomain name.
- Get your apikey from the top right Profile Menu->API, inside your Businessmap Account
- Get the exact column_id and lane_id where you want the card to be created.
You can use the API V2 methods or the following facility to show a board structure details.
Businessmap to ServiceNow
This direction uses Businessmap's business rules.
The scope of the below example is a simple bi-directional integration, covering the scenario when the card in Businessmap is created from an Incident in ServiceNow, by moving the card to 'Done' in the Businessmap Workflow, the business rule will close the incident in ServiceNow.
The first step is to create the business rule by selecting the right trigger:
Set up the conditions of the business rule and the action of calling a Web Service.
This is how to define the WebService configuration for using the APIs of ServiceNow.
IMPORTANT: For the call to work, you need to make sure the following is properly set:
- The URL has to point to your ServiceNow account
- Add the "Custom Card Id" in the URL, that is the ID of the incident to be updated.
- In this example, incident_state with value 6, would mark the incident as closed, but you might need to adjust the parameters for your specific use case.
If you have any issues setting up the integration, just reach out to our support team!