Matrix rule sets
The fields and types of a matrix rule set, which sets one field from others on a form, and the shipped incident priority matrix.
A matrix rule set fills in one field on a form from the values of others, such as an incident’s priority from its impact and urgency. This page lists its fields and the rule set Servicely ships, for administrators who change how a field is derived.
How a rule set runs
Matrix rule sets are kept under Application → Field → Matrix rulesets. The menu section needs the configuration_administrator role.
| Behaviour | Detail |
|---|---|
| Where it runs | On the form, in the user’s browser, as the user edits the record. |
| When it runs | When a source field changes, if On change is set. When the form opens, if On load is set. |
| Which tables | The table named on the rule set and every table that extends it. A rule set on a child table replaces one on its parent for the same source fields. |
| Who it runs for | Every user who can read the table, whatever their access to the rule set table. |
| Target field | Set to the result. With Read only set, users cannot change it by hand. |
Matrix rule set fields
| Field | Type | What it holds |
|---|---|---|
| Name | String | The name of the rule set. |
| Active | Boolean | Whether the rule set runs. |
| Type | Choice | How the target value is found. See the next table. |
| On load | Boolean | Run the rule set when the form opens. |
| On change | Boolean | Run the rule set when a source field changes. |
| Table | Table | The table the rule set applies to, with the tables that extend it. |
| Source fields | Field array | The fields the value is derived from. A matrix takes one, two or three. |
| Target field | Field | The field the rule set sets. |
| Read only | Boolean | Make the target field read only on the form. |
The form has three tabs for the rule itself. Matrix shows a grid with a row or column per value of each source field, and an editor for the target value in each cell. Script holds the script. Data holds the matrix as JSON.
Rule set types
| Type | Key | What it does |
|---|---|---|
| Matrix | matrix |
Looks up the target value in the grid, by the values of the source fields. |
| Mapping | mapping |
Not implemented. The value is inactive, so you cannot choose it. |
| Script | script |
Runs the script in the browser and sets the target field to what it returns. The script receives current, the record on the form. |
Shipped rule set
Servicely ships one rule set. It derives incident priority from impact and urgency. On requests, changes and problems, priority is set by hand.
| Name | Type | Table | Source fields | Target field | On change | On load | Read only |
|---|---|---|---|---|---|---|---|
| Update Priority | Matrix | Incident | Urgency, Impact | Priority | Yes | No | No |
Its matrix gives these priorities:
| Impact | Urgency High | Urgency Medium | Urgency Low |
|---|---|---|---|
| High | P1 | Critical | P2 | High | P3 | Medium |
| Medium | P2 | High | P3 | Medium | P4 | Low |
| Low | P3 | Medium | P4 | Low | P5 | Planning |
The rule set’s Read only is off. An incident UI event makes Priority read only on the incident form instead. To change how incident priority is derived, edit the cells of this matrix rather than the Priority choices.