In this article:
1. How to Create the Rule?
2. How to Set Up and Enable the Rule?
2.1. WHEN
2.2. AND
2.3. THEN
3. Practical Examples of Using the 'Card Count' Rule
This business rule will trigger a predefined action (create, move, update, send a notification, call web service) whenever the number of cards in a predefined set of columns/lanes/cells satisfies a limiting condition. A common example would be to send a notification to the Board Manager/PM when there is a critical number of cards in a “For Review” column. Through this rule, you can identify and manage bottlenecks and process inefficiencies.
1. How to Create the Rule?
Only users with "Account Owners" or "Manage Business Rules" privileges can create business rules. Go to your Administration panel at the top right of your screen, open the Business Rules tab, and select the "Card count" rule.
Note: Use the Add New Rule button at the upper right side of the panel if there is a set of predefined rules to your account.
2. How to Set Up and Enable the Rule?
The "Card count" configuration panel has the following fields and properties:
In the Name and Description fields, you can change the name of the rule and describe the scenario you will achieve with it. This way you can create an overview of your active business rules, as upon creation every automation is present in the Business Rules panel.
PRO tip: You can specify the board name in the rule name in order to easily distinguish rules configured for each of your boards.
You can share the rule with other users (e.g. with a Workspace Manager of a board), if necessary. That way, they will be able to edit/disable/enable the rule.
Business Rules are a sort of "point-and-click" programming language with which you can automate any process. Each Business Rule has three main properties: When; And; Then.
1. WHEN
Here you define the position and the number of the cards that will trigger the action.
- Position: Click on Not Set to select a board from the dropdown and a position (you can select a cell or an entire column by clicking on the column's name) from the board minimap.
Click on "or" to add extra positions and optimize the scope of the rule. Use the minus sign to remove a position.
- Number of matching cards: Select one condition from the dropdown and set a number. You can choose between: number becomes equal to/becomes greater than/becomes less than/is equal to/is greater than/is less than.
For example: If you configure the rule to send you a notification email when the number of cards with priority critical in the "Working On" column of board "X" "is greater than" 3, you will receive an email every time the number of critical cards in this position is greater than 3, which means when there are 4, 5, 6, etc. matching cards. If you configure the rule to send you a notification email when the number of cards with priority critical in this position "becomes greater than" 3, you will receive an email only once, when the number of matching cards becomes 4.
Thus, if an operator with BECOMES is selected, the business rule will trigger only once (when the filter is met). If an operator with IS is selected, then the policy will trigger every time the filter is met.
2. AND
Here you define the filters, which specify the conditions under which the actions should be triggered.
Click on the Add new property button → select a Regular field or/and a Custom field → click on Add.
For all time-related fields, you can select the following units: Days, Hours, Minutes, Seconds.
When you have added the filter, set it up by clicking on Not set or entering a value.
Note: You can add as many filters as you wish by clicking on Add new property and repeating the steps.
3. THEN
Select an action to be triggered.
Click on Add new action under the type of action you want to be triggered. Select your preferred action if there are several options, click on Add, and choose the value from the dropdown or click on Not set to configure it.
You can add more than one action from one type by repeatedly clicking on Add new action and configuring it.
The following actions can be triggered:
1) Create cards or subtasks — The following types of cards can be created:
Click on add new action and use the supporting panel to select the type of cards you want to create, i.e. a new card, a child card, a parent card, a relative card, or a subtask.
You can create multiple cards/subtasks and the cards can be rearranged in order to be created in the desired sequence - simply drag and drop a card to rearrange it before or after another.
Note that subtasks cannot be rearranged within the rule configuration, so in case you have a subtask among the cards that are to be created, you would not be able to move a card on the subtask's position.
2) Update the card details — The following card details can be updated when the number of cards in the predefined position matches the defined condition.
Select a regular field or a custom field that you have created and added to the corresponding boards in your Workspaces → click on Add. Choose the value from the dropdown or click on Not set to configure the action.
Practical tip: When the number of cards on position "X" with priority "critical" matches "3" → change the color of the cards to red.
3) Send notifications — The system will notify a user of your choice when the condition is fulfilled. Create a template for the notification, which is to be sent, and click on Save Message.
- In the To:/Cc: field → use the "add internal users" dropdown which opens a list of all users in your account including: Self, Owner, Watchers, Contributors, Reporter. Select and add the user/s you wish to be notified. The "add custom field" option is used in the following case: if you have a custom field with an email address and the created card contains this custom field, the notification will be sent to this email address.
- The subject of the notification email contains by default: the text "Cards count changed in" and the board name. You can modify the title by clicking on "add card fields" and select your preferred field/s or you can remove all fields and write a custom title.
- Email body: you can either keep the predefined text or modify it by deleting and creating a new text.
Practical tip: When the number of cards on position "X" with priority "critical" matches “3” → the system will automatically send an email notifying a user (e.g. a Workspace Manager).
4) Move the card — choose where to move the card. Select a board from the dropdown and a position from the board minimap (you can select a cell or an entire column/swimlane by clicking on its name).
Practical tip: When the number of cards on position "X" with priority "critical" matches "3" → move the cards to the "Expedite" swimlane on the board.
5) Invoke web service — Click on Add new action to add a call to external web service → click on Not Set to configure the parameters.
You can configure the following options:
Name – a human-readable identifier for the web service call
URL – the address of the endpoint service
Method – which HTTP method should be used for the call (available options are POST, GET, HEAD, PUT, DELETE, OPTIONS, PATCH)
Authentication – NONE or BASIC authentication supported for the moment
HTTP Body – Whether you want to send the payload as raw JSON-encoded values, directly in the HTTP body
Parameters – parameters to be sent to the endpoint service
Headers – custom headers to be sent to the endpoint service
To send the parameters in the body of the web service call -> activate the checkbox.
Additionally, the POST, PUT, DELETE, and PATCH requests send an additional parameter – ‘kanbanize_payload’ that contains information about the card that has been created or moved. The payload is in the following format:
{
“trigger” : “taskCreated”,
“timestamp” : “2015-03-04T14:19:38+00:00”,
“card” : {
“taskid” : “35156”,
“title” : “”,
“description” : “”,
“tcolor” : “#34a97b”,
“priority” : “Average”,
“size” : null,
“owner” : “testAdmin”,
“deadline” : null,
“typeName” : “”,
“tags” : “”,
“extLink” : “”,
“reporter” : “testAdmin”,
“createdAt” : “2015-03-04 14:19:33”,
“columnname” : “Requested”,
“lanename” : “Default Swimlane”,
“boardName” : “my board”,
“customFields” : [
],
“boardid” : “131”
}
}
When the payload is received by the endpoint, the content of “kanbanize_payload” can be parsed and the required actions can then be performed by the external system.
Click on the green plus sign to add a parameter. Select a field you wish to set as a parameter → click on Apply. When you have configured your parameters, use the Test Settings button to send a pre-scanned request for testing and debugging purposes only. Click on Save Service to save the configuration. For more information, please check our API documentation.
To enable the rule, click on the Save button in the lower right corner of the configuration panel.
3. Practical Examples of Using the 'Card Count' Rule
This rule is especially useful when it comes to managing workload. You can use it to alert when a critical number of cards is reached or exceeded so more resources can be allocated to working on those cards.
In a support setting, you can use this rule when there are too many Urgent tickets to allocate more customer service representatives to those tickets.
Another way this rule can help is by focusing people on finishing the tasks rather than starting new ones.