In this article:
1. How to Create the Rule?
2. How to Set Up and Enable the Rule?
3. Practical Examples of Using the "Card is Created" Rule
Thе Card is Created business rule will trigger a predefined action (create, move, update, send a notification, call web service) whenever a card is created. A typical example would be to update the card color if it is created in a predefined set of columns/swimlanes.
1. How to Create the Rule?
Only users with "Account Owners" or "Manage Business Rules" privileges can create business rules.
To configure the business rule, go to the Administration panel at the top right side of your screen → open the Business rule tab → select the "Card is created" rule option.
Note: In case there is a set of defined rules to your account → use the Add new rule button at the upper right side of the panel.
2. How to Set Up and Enable the Rule?
The "Card is Created" configuration panel has the following fields and properties:
(1) Name - give a name of the rule to distinguish it.
(2) Description - provide a description of the rule behavior in the system.
Note: when a business rule is created, it will get a rule ID and will be made available in the Business rule panel under name and description.
PRO tip: You can specify the board name in the rule name in order to easily distinguish rules configured for each of your boards.
(3) Share with: this option allows you to share the rule with other users in the system so that they can edit/disable/enable the rule.
Every business rules have three main control settings: When; And; Then.
It is a sort of "point-and-click" programming language with which you can automate any process. The way it works is based on the programming conditional statement "if this then that".
To save/enable a rule, click on the Save button at the bottom right corner of the configuration panel.
(4) WHEN - this is the event that will trigger an action (i.e. When a card is created).
(5) AND - define the filters and select the conditions under which the actions should be triggered.
- When users create a new rule, the Board filter will be applied by default. This means that the rule will be executed only for the boards you specify in the filter. If you remove the board property and enable the rule, it will be executed for the entire account. You can use "or" to add extra boards and optimize the scope of the rule. Use the bin icon to remove the board.
- Use "Add new property" to further configure the automation. Select a regular or custom field from the panel (for example: Owner: set it up).
As a result, the rule will be triggered only for cards located at the defined board and for the selected owner.
(6) THEN: Select an event that will happen if the created card matches your filter.
- create cards or subtasks - 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, relative card, or a subtask.
Note that 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 in order 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.
When you make your choice, please define the new card/child/parent/relative/subtask position via the board minimap.
- update the card details - click on add new action and update the properties that you want to update when a card is created. Select any of the available options and set it up.
- link the card - click on add new action to link the created card as a child, parent, predecessor, relative, or successor to another card.
- move the card - click on add new action to open the Board Minimap option and select where to move the card that has been created.
→ select a Board from the dropdown list (1) and pick a position (column/lane) (2) at the board minimap.
- send notifications - click on add new action
Every time "a card is created," a user or a set of users will receive an email if you select to configure this option and create a template for the email notification, which is to be sent.
- 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 that will be notified. The "add custom field" option is used 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 title of the executed rule, board name, card ID and the text "New card created". You can modify the title by clicking on "add card fields" and select your preferred card properties to display. You can remove all fields and write a custom title.
- Email body: you can either keep the predefined text or change it according to the information you want to share with the users.
- invoke web service - click on add new action to add a call to an external web service.
To configure it, select "not set" and set 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 а 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.
Check the Businessmap API documentation here.
To enable the rule → click on the Save button at the lower right corner of the configuration panel.
Click on the red x-sign to cancel the creation of the rule.
3. Practical Examples of Using the "Card is Created" Rule
Here are a few examples of how to utilize this rule to automate tasks:
- One use of this rule is to move cards where they have to be on the board depending on the Type of card created. When a card is created and a Card Type is assigned to the card, the card is sorted into the correct column/swimlane/cell on the board. In this example, there are two swimlanes in the Cards Workflow and if the card type is 'Project', the card goes to the requested column in the 'Project' swimlane.
- Another use of this rule is to update the card details depending on the location of the created card. If a card is created in Team A's swimlane, the details of the card can be updated by setting a 1-day deadline and changing the card's color to Orange. You can also assign the card to a specific user. This would bring more visibility for the people working on that board.