How can you benefit from using the Business Rules?
Here is a brief explanation of what the business rules in Kanbanize 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 Kanbanize and ServiceNow?
ServiceNow to Kanbanize
The scope of the integration could be to link, for example, a record in ServiceNow (incident, issue, task, etc. ) to a Kanbanize 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.
At the example bellow the rule will be triggered only if in 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 Kanbanize 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 snipped you can copy and paste in the business rule. This one creates a card in Kanbanize, 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');
"exceeding_reason": "just in case"}'); var response = request.execute(); current.work_notes = response.getBody(); current.update();
IMPORTANT: In order for the code to work, you need to make sure the following is properly set.
- The endpoint URL has your kanbanize account subdomain name.
- Get your apikey from the top right Profile Menu->API, inside your Kanbanize 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.
Kanbanize to ServiceNow
In this direction, the Kanbanize business rules are used.
The scope of the below example is a simple bi-directional integration, covering the scenario when the card in Kanbanize is created from an Incident in ServiceNow, by moving the card to 'Done' in the Kanbanize 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: In order 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!