mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Corrected from the code: card aging is in Board Settings / All Boards Settings; Mark as complete is off by default on both sides; the checklist menu says Edit as text and Automatic reset, whose Off is Off (do not reset automatically); Card recurrence is under Move and copy in the card menu; Reset width follows Create cards from action items; comment replies are grouped under their parent and capped at one level; Admin Panel / Settings / Features holds Card fields; the Card section lists Blocked, Class of service, MoSCoW and WSJF. Thanks to xet7 !
5.2 KiB
5.2 KiB
At risk
What it is
A card that looks like it will not get done in time gets an At risk mark: a small red triangle on the minicard, and in the opened card a line saying why. The mark is a weighted score of five plain rules - overdue, due soon with the checklist behind, blocked, idle, sent back - so anybody can read why a card was marked, instead of a prediction nobody can check. It needs no AI and no setup.
Read more
- Project risk management and Risk management on Wikipedia - the subject the mark is a small, rule-based part of.
- Kanban (development) - blocked, idle and sent-back work are the flow problems a Kanban board shows.
- In WeKan: Due date, Checklists, Flow fields (Blocked), Forecast and Helpers that need no AI.
How to use it
See which cards are at risk
- Open a board. A minicard with a small red triangle is at risk.
- Click the minicard to open the card. Under Date, the At risk line lists every reason that applied, for example overdue; blocked by "Order parts".
- Fix what the reasons name - set a new due date, tick the checklist items, finish the blocking card, move the card on - and the mark goes away by itself.
Hide it
- Open the board's cog menu, Board Settings, then Card (Card Settings).
- In the Date section, untick the At risk row: in Show on Minicard for the triangle, in Show on Card for the line in the opened card.
- A site admin hides both on every board from Admin Panel / Settings / Features / Card fields.
How the numbers are calculated
From models/lib/cardRisk.js:
| Reason | Rule | Points |
|---|---|---|
| Overdue | the due date has passed and the card is not complete | 3 |
| Due soon | due within two days (DUE_SOON_DAYS = 2) and less than half of its checklist items are done (finished / total < 0.5, only when it has checklist items) |
2 |
| Blocked | another open card it depends on (is blocked by) is not done |
2 |
| Idle | no activity for 14 days (IDLE_DAYS = 14), while not in the board's first or last list |
2 |
| Sent back | moved to an earlier list twice or more (SENT_BACK_MOVES = 2) |
1 |
- The score is the sum of the points of the reasons that apply. A card with
3 points or more (
THRESHOLD = 3) is at risk, so being overdue alone is enough, and any two of the other rules are too. - Overdue and Due soon exclude each other: a due date that has passed is only Overdue.
- A complete card never is at risk: one marked complete (
dueComplete), one with an end date, or one that is archived. - Idle counts whole days since the card's last activity
(
dateLastActivity, elsemodifiedAt):floor((now - last) / 1 day). - Sent back counts the card's moves where the list it went to is before the
list it came from in the board's list order (
countBackMoves). - The minicard reads only what the minicard already has (dates, checklist counts, dependencies, last activity), so it never counts Sent back; the opened card also counts the moves and so may score one point higher.
How it works in WeKan
- models/lib/cardRisk.js is pure (no
Meteor):
cardRisk(card, context)returns{ atRisk, score, reasons },countBackMoves(moves, listSort)counts the moves back, andREASON_KEYSnames the i18n key of each reason (at-risk-reason-overdue...at-risk-reason-sent-back). - client/lib/cardRiskOf.js
riskOf(card, { withMoves })hands the rules what the client has: the real card of a linked card, the checklist counts, the openis-blocked-bydependencies, whether the list is neither the first nor the last of its swimlane's lists (or of the board's shared lists), and - withwithMoves, on the opened card - themoveCardactivities. It joins the translated reasons with;. - client/components/cards/minicard.js
draws the triangle (
atRisk), and client/components/cards/cardDetails.js the line with its reasons. - The board flags are
allowsAtRiskOnCardandallowsAtRiskOnMinicardin models/boards.js, both on by default (models/lib/cardSettingsRows.js, rowatRiskin the Date section). The Admin Panel's Card fields overlay is models/lib/cardFieldVisibility.js. - Nothing is stored: the score is computed whenever the card is drawn.
- Tests: tests/cardRisk.test.cjs (the five rules, their points and the threshold) and tests/playwright/specs/assist-at-risk.e2e.js.