Docs Custom Fields

TCM Custom Fields

About URLs in examples: all examples use 127.0.0.1:5770 as the default Mockarty address. If your instance runs on a remote server, replace it with the actual address. See Tips & Useful Features for details.

Custom fields let you attach your own structured metadata to a test case —
beyond the built-in fields like priority, owner, and tags. Each custom field is
a simple name + value pair (for example Component: checkout,
Layer: integration, Feature: payments). They are perfect for the
classification dimensions every team invents but no fixed schema can predict.

Unlike a rigid, admin-defined schema, Mockarty’s custom fields grow from the
cases you save
: the field names and values you actually use become a namespace
dictionary that powers autocomplete, so the next case reuses them consistently
instead of accumulating typo-variants.

Adding custom fields to a case

In the test-case editor, open the case’s metadata panel and find the
Custom fields section. Each field has:

  • a type hint — text, select, url, date, feature, story, or
    component (a label for how the value is meant to be read);
  • a name (the field key, e.g. Component);
  • a value (e.g. checkout).

Type a name and value, press the add (+) button, and the field is attached.
Use the × on any field to remove it. Custom fields are saved with the case.

How the dictionary grows

Every time you save a case, the names and values it carries are recorded into
the namespace custom-field dictionary. This happens automatically and in the
background — it never slows down or blocks saving the case. Over time the
dictionary becomes the catalogue of every field name and value your team has
used in that namespace, so:

  • field names you have used before are suggested when you type a new field name;
  • known values for a given field name are suggested when you fill in its value.

The dictionary is per namespace — one project’s field vocabulary never
bleeds into another’s.

The dictionary API

The dictionary is served by read endpoints under
/api/v1/namespaces/{namespace}/tcm/custom-fields. All reads require the
tcm_configuration:read permission; send your API token as
Authorization: Bearer <token>.

Autocomplete field names

GET /api/v1/namespaces/{namespace}/tcm/custom-fields/keys?q=<prefix>

curl "http://127.0.0.1:5770/api/v1/namespaces/default/tcm/custom-fields/keys?q=comp" \
  -H "Authorization: Bearer $MOCKARTY_API_TOKEN"
{ "keys": ["Component"], "count": 1 }

The q prefix is optional; omit it to list all known field names.

Autocomplete values for a field

GET /api/v1/namespaces/{namespace}/tcm/custom-fields/values?key=<name>&q=<prefix>

curl "http://127.0.0.1:5770/api/v1/namespaces/default/tcm/custom-fields/values?key=Component&q=che" \
  -H "Authorization: Bearer $MOCKARTY_API_TOKEN"
{ "key": "Component", "values": ["checkout"], "count": 1 }

The key parameter is required; q is an optional prefix filter.

List the dictionary

GET /api/v1/namespaces/{namespace}/tcm/custom-fields

Returns every field name with the number of distinct values recorded for it:

curl "http://127.0.0.1:5770/api/v1/namespaces/default/tcm/custom-fields" \
  -H "Authorization: Bearer $MOCKARTY_API_TOKEN"
{
  "keys": [
    { "key": "Component", "valueCount": 7 },
    { "key": "Layer", "valueCount": 3 }
  ],
  "count": 2
}

Pruning the dictionary

Because the dictionary grows from real usage, it can collect stale suggestions —
a value you used once on a since-deleted case, or a field name from an
abandoned convention. You can remove these suggestions.

Important: pruning a suggestion only edits the autocomplete dictionary.
It never touches the cases themselves — a field you remove from the dictionary
stays on any case that already has it.

Pruning requires the namespace:write permission (the same owner-level gate
as the workflow/state editor).

Remove a field name (and all its values)

DELETE /api/v1/namespaces/{namespace}/tcm/custom-fields/keys/{key}

curl -X DELETE "http://127.0.0.1:5770/api/v1/namespaces/default/tcm/custom-fields/keys/Layer" \
  -H "Authorization: Bearer $MOCKARTY_API_TOKEN"

Returns 204 No Content.

Remove a single value

DELETE /api/v1/namespaces/{namespace}/tcm/custom-fields/values?key=<name>&value=<value>

curl -X DELETE "http://127.0.0.1:5770/api/v1/namespaces/default/tcm/custom-fields/values?key=Component&value=legacy-cart" \
  -H "Authorization: Bearer $MOCKARTY_API_TOKEN"

Returns 204 No Content. Both key and value are required.

Every prune is recorded in the audit log.

Custom fields from imports

Custom fields are also populated by migration imports. A
TestIT bulk import maps each TestIT attribute onto a
custom field (name/value), and those names and values flow into the dictionary
just like a manually saved case — so your imported catalogue’s classification
becomes searchable autocomplete immediately.

See also