docs/Features/Rules/Rules.md
WeKan Rules automate your board: when something happens (a trigger), WeKan runs a action. This is WeKan's equivalent of Trello's Butler.
Open Rules from the board sidebar → Rules. The Rules page is a fullscreen page below the top bar (it used to be a small popup).
A rule links one trigger to one action:
When a card is moved to list "Done" → then mark the card complete.
Triggers and actions both support a wildcard * meaning "any" (for triggers) or
"the card's current value" (for actions).
On the Rules page you can:
When … → Then …) and add the rule, or drag an
action onto an existing rule to change what it does. Existing rules are shown as
connected When → Then nodes you can delete. This is similar to a Jira workflow.
Evaluated by a server cron job every minute:
Action text fields support Trello-Butler-style variables in {name} form,
substituted when the rule runs. They work in the email subject/body, the created
card name, and created checklist/swimlane names:
| Variable | Value |
|---|---|
{cardname} / {cardtitle} | the card's title |
{cardnumber} | the card number |
{description} | the card's description |
{duedate} | the card's due date |
{listname} | the card's list |
{swimlanename} | the card's swimlane |
{boardname} | the board's title |
{username} | the user who triggered the rule |
{date} / {time} / {datetime} | the current date / time / both |
Example email body: Card {cardname} (#{cardnumber}) moved on {datetime} by {username}.
Unknown {tokens} are left unchanged.
This common "process" works out of the box with a scheduled card-aging trigger plus the archive action:
When a card has been in list "Completed" for 90 days (checked daily) → then archive the card.
Create it on the Rules page (Scheduled triggers → "card in list for N days"), or via the REST API.
Click Import / Export on the Rules page.
The Import / Export dialog can import a visual workflow exported from n8n or Node-RED (auto-detected, or pick the format). The workflow graph's trigger→action edges are mapped to WeKan rules by recognizing trigger-like and action-like nodes (schedule/cron → scheduled rule; webhook/trigger → "card created"; archive/move/complete/email/create-card actions). Nodes that can't be mapped are reported. The rules are created in the board you selected under Import target.
These formats are arbitrary-integration graphs, so the mapping is best-effort. Importing rules/workflows with a whole board is supported for WeKan→WeKan (see below); n8n/Node-RED bring workflows only, into a chosen existing board.
A WeKan board export already contains its rules/triggers/actions, so importing a board brings its workflows and all other data with it:
POST /api/boards/import with { "board": <export JSON> }
(python3 api.py importboard EXPORT.json).python3 api.py migratefromwekan REMOTE_URL REMOTE_USER REMOTE_PASS logs in to a
remote WeKan, lists that user's boards, exports each (full JSON incl. rules), and
imports each into your WeKan via POST /api/boards/import. The remote fetch is done
by the client/script (not the server), so no arbitrary-URL fetch happens server-side.
Trello's board export does not contain Butler rules/automation (confirmed: the Trello importer never receives them). So rules cannot be imported automatically from a normal Trello export. The Import / Export dialog offers a best-effort importer: paste your Butler command text and WeKan maps the recognizable subset (for example "when a card is added to list X, move the card to the top") and reports the lines it could not map.
Jira board/data import lives under All Boards → New → Import → Jira (see
Jira import). If the Jira JSON includes an automationRules array in
the WeKan { title, trigger, action } shape, those rules are imported with the board
(best effort).
WeKan can import boards from Jira, similar to Trello:
GET /rest/api/2/search) or an equivalent { "issues": [ … ] } object.Jira statuses become lists (the workflow columns), each issue becomes a card
(title [KEY] summary, description, due date, created/updated dates), Jira labels
become board labels, and assignees become card members. An optional
automationRules array is imported as WeKan rules.
Manage rules over REST (see also api.py
addrule / editrule / removerule / listrules / getrule):
| Method | Path | Purpose |
|---|---|---|
GET | /api/boards/:boardId/rules | list rules |
GET | /api/boards/:boardId/rules/:ruleId | get one rule |
POST | /api/boards/:boardId/rules | add a rule |
PUT | /api/boards/:boardId/rules/:ruleId | edit a rule |
DELETE | /api/boards/:boardId/rules/:ruleId | remove a rule |
POST/PUT bodies embed the trigger and action inline:
{
"title": "Archive after 90 days",
"trigger": { "activityType": "scheduledTrigger", "scheduleKind": "aging",
"listName": "Completed", "days": 90, "atTime": "03:00" },
"action": { "actionType": "archive" }
}
python3 api.py addrule BOARDID 'On create -> top' \
'{"activityType":"createCard","listName":"*","swimlaneName":"*","cardTitle":"*","userId":"*"}' \
'{"actionType":"moveCardToTop","listName":"*","swimlaneName":"*"}'