- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
Custom Fields
What it is
Custom fields are a board's own extra fields for its cards, beside the built-in title, dates, members and labels: a release version, a budget, a customer, a checkbox, a choice from a list. A board member who may change the board defines a field once for the board - its name and type - and then each card can carry a value for it, shown on the opened card and, when chosen, on the minicard. Number and date fields can also be summed or ranged at the top of each list.
Read more
- Field (computer science) on Wikipedia - what a field is.
- Kanban (development) - the board whose cards these fields describe.
- Template processor, Percent-encoding and Regular expression - for the String Template type.
- In WeKan: Admin only and display order, Linked custom fields and Card Settings, where a board's custom fields are managed.
To translators, about the word Custom
See other feature for description of Custom Customize Translations
How to use it
The screenshots below are from an older WeKan; the steps under each are the current menus.
1) Open the board's custom fields: Board Settings → Card (the board's cog menu), then the Custom Fields section of Card Settings. (In the older WeKan of the screenshot this was Board hamburger menu / Custom Fields.)
2) Create a field: click + (Create Field) under the section's fields, fill in Name and Type, the type's settings and the checkboxes, and click Save.
- Type is one of Text, Number, Date, Dropdown List, Dropdown (multi-select), Checkbox, Currency and String Template. It cannot be changed after the field is created.
- Currency asks for a Currency Code; Dropdown List and the multi-select for their List Options (press Enter to add more); String Template for a Format and a Separator (below).
- Show this field on card, Add field to new cards, Add field to all cards and Show field label on minicard decide where the field appears; Show sum of fields at top of list is offered for Number and Currency fields.
- Only on these card kinds limits the field to Story or Task cards (none ticked: every card).
- A board admin also sees Visible only to board admins and Read-only: every member sees the value, only board admins change it (Admin only and display order).
3) Add it to a card: open the card and click the hamburger at the end of its Custom Fields heading. The Edit custom fields popup lists every custom field of the board, ticked when it is on this card. (In the older screenshot: Card Details hamburger menu / Edit custom fields.)
4) Click your custom field's name to put it on the card (click again to take it off). The pencil beside it edits the field; Create Field and Link fields to another card are at the bottom of the popup.
5) Set its value: click the field on the card (its title or its value) and enter or choose the value, then Save.
6) The custom field is shown at the minicard and the card details.
Editing or deleting a field: in Card Settings' Custom Fields, the field's hamburger opens its edit form, with Save and Delete; in the card's Edit custom fields popup, its pencil does the same.
How the numbers are calculated
- Sum at top of list (
sumCustomFieldValuesandnumberFieldStatsin models/lib/customFieldsSum.js, shown by client/components/lists/listHeader.js): for every Number field with Show sum of fields at top of list, the values on the list's cards that are not archived (per swimlane when the list is shown in swimlanes) are added up and shown as ∑ N. Only Number fields are summed: the checkbox is also offered for a Currency field, but the list header reads onlytype: 'number'. A card without the field or with an empty value adds 0; a text value is read as a number with a comma or a dot as the decimal mark, and one that is not a number is skipped. The badge's tooltip adds the smallest and largest value and how many of the list's cards have a value, as(min–max, count/total). - Date fields with
showSumAtTopOfList(the form does not offer the checkbox for a Date field; it can be set through the REST API) show the earliest and latest date on the list's cards instead of a sum (dateFieldRange), as one date when they are the same. - Currency values are formatted with the browser's
Intl.NumberFormatin the field's currency. - String Template regular expressions: the pattern is at most 200
characters and the value at most 10,000, and on the server it runs with a
50 ms time limit
(models/lib/customFieldStringTemplate.js,
server/lib/boundedRegex.js). - Display order: a new field's
sortis the number of fields the board already has, so it goes last (Admin only and display order).
How it works in WeKan
- Definitions are the
customFieldscollection (models/customFields.js):boardIds,name,type,settings(currencyCode,dropdownItems,stringtemplateFormat,stringtemplateSeparator),showOnCard,automaticallyOnCard,alwaysOnCard,showLabelOnMiniCard,cardKinds,showSumAtTopOfList,readOnly,adminOnlyandsort. Its REST API and server hooks are in server/models/customFields.js; every writing REST handler needs board write access. - A card's values are
cards.customFields, a list of{ _id, value }; models/lib/customFieldsWD.js joins them with the definitions of the card's current board, in display order, and skips values whose definition is not on that board. - The edit form is
createCustomFieldPopupin client/components/sidebar/sidebarCustomFields.jade; Card Settings' Custom Fields section is models/lib/cardSettingsCustomFields.js; the card's popup and value editors are client/components/cards/cardCustomFields.jade. - Tests:
tests/customFieldsWD.test.cjs,tests/customFieldsSum.test.cjs,tests/customFieldStringTemplate.test.cjs,tests/cardSettingsCustomFields.test.cjs,tests/customFieldInteraction.test.cjs,tests/restCustomFieldUpdate.test.cjs,tests/restCustomFieldDelete.test.cjsand the browser teststests/playwright/specs/rest-custom-field-update.e2e.js,rest-custom-field-delete.e2e.js,rest-dropdown-item-update.e2e.jsandminicard-filled-custom-fields-6811.e2e.js.
String Template variables
A String Template formats each nonempty value entered on the card, then joins those results using the field's separator. The same format appears on minicards and in card details. Available variables are:
| Variable | Value |
|---|---|
%{value} |
The current item entered in this custom field |
%{card.title} |
Card title |
%{board.title} |
Board title |
%{list.title} |
List title |
%{swimlane.title} |
Swimlane title |
Names are case-insensitive. The spelling {%card.title} (percent sign inside
the braces) also works. Titles and formats update while the card is open.
Linked cards use their source card's context, just as they use its custom-field
values. Unknown variables or unavailable context remain literal text. These
variables do not expose arbitrary document properties or other custom fields.
Append |urlencode to encode a value as a URL parameter. For example, a label
printer link can use this format:
[Print label](https://printer.example/print?label=%{value|urlencode}&card=%{card.title|urlencode}&lane=%{swimlane.title|urlencode})
Spaces, Unicode and characters such as &, # and ? are encoded within each
parameter, rather than changing the URL's structure. The normal Markdown viewer
still handles links and sanitization. Variable contents are substituted once;
text inside a card title is never evaluated as another template.
The existing regular-expression replacement applies to the current item and can be mixed with the variables:
${"regex":"^([A-Z]{2})-(.*)$","flags":"i","replace":"$1 / $2"}
Invalid regex definitions remain visible instead of preventing card rendering.
This is the Custom Fields String Template feature requested in
#3815; Rules action templates use
their separate {card}, {board} and other rule variables.
To copy field values between two cards, for example from each worker's card to a main card on another board, see Linked custom fields.
Commits
- REST renaming of dropdown options fixed
- deleting a dropdown item no longer acknowledges missing options
- deleting a custom field no longer acknowledges missing records
- partial REST custom-field updates fixed
- Card Settings: two panes, custom fields managed in them
- Card Settings / Custom Fields: Create Field and Link fields as forms in the pane
- Story and Task cards, with custom fields of their own
- read-only custom fields that every member sees and only admins set
- a date custom field named in its tooltip
- card context and URL encoding in String Templates
- a String Template regex can no longer stop the server (ReDoS)
- list-header summary with min/max and a date-field range
- the Admin only flag
- a multi-select dropdown type
- a user-settable display order, by drag and drop
- copy controls on every custom field
- card and minicard visibility separated
- custom-field interactions and deleted-field exports fixed
- the Custom Fields popup shows a new field, with the pencil beside the name
- everything about custom fields on the section that shows them
- a number field no longer shows NaN when cleared
- read-only board members can no longer write custom fields through the REST API
- sum of cards at the top of a list
- String Template custom field type
- option to add a custom field to all cards
- Currency custom field type
- custom fields upgrade
- dropdown items
- number and date fields
- custom fields creation UI and model, first version