Multi-tenancy configuration
The applications, records, table flag, table properties and scripts that configure multi-tenancy, with their values.
This page lists every object that configures multi-tenancy: the applications to install, the records you create, the table flag and properties, and the scripts. Read Multi-tenancy first for what realms, tenants and providers are.
How to read these tables
The records are under Administration → Tenancy. To set up tenancy you install Tenancy Core and one hierarchy application, create the realms or use companies, separate each table, and create a System tenancy configuration. Then give each user a realm or a company. Tenancy is active as soon as the System tenancy configuration table exists.
Applications
| Name | Value | Notes |
|---|---|---|
tenancy_core |
Tenancy Core | Adds System tenancy configuration, the Tenancy menu section and the Self service provider. |
tenancy_realm_hierarchy |
Tenancy — Realm Hierarchy | Adds System realms and the Realm hierarchy provider. Needs Tenancy Core. |
tenancy_company_hiearchy |
Tenancy — Company Hierarchy | Adds the Company hierarchy provider only. Needs Tenancy Core. The application name is spelled this way in the product. |
tenancy_realm_hiearchy_company_quickstart_v1 |
Tenancy Realm Hierarchy — Company Quickstart | A development application that maps companies to realms with a refresh job and fallback-company properties. |
System tenancy configuration fields
| Name | Value | Notes |
|---|---|---|
| Name | Text, unique | |
| Provider | Self service, Realm hierarchy or Company hierarchy | The filter to apply. The choices depend on the applications installed. |
| Script | Script | Decides whether the configuration applies to the current user. Any result other than false applies it. |
| Active | Yes or No | |
| Order | Number | The order among configurations. |
| Description | Text |
System realm fields
| Name | Value | Notes |
|---|---|---|
| Name | Text | |
| Parent | Reference to a realm | Places the realm in the tree. A realm with no parent starts a tree. You can have several trees. |
| CIDR | CIDR | Set by Servicely so a realm’s subnet contains its children’s. |
| Full path | Text, read-only | The realm’s path from the top of the tree. |
| Active | Yes or No | |
| External key | Text, unique | The realm’s ID in another system. |
| Custom child subnet bitshift | Number | Overrides the default subnet size for this realm’s child realms. [UNVERIFIED] |
| Realm selection require role | List of roles | Roles a user needs to see this realm in the realm selector. See the rules below. |
| Realm hierarchy require role | List of roles | Roles a user needs to see this part of the tree. |
Rules for Realm selection require role:
- You can set it on any realm in the tree.
- Realms below inherit the restriction of realms above them.
- A setting lower in the tree overrides one above it.
- It applies from the user’s own realm downwards. If a user cannot see their top realm, they see no realm below it either. For example, if only the top realm requires
itsm_agent, users withoutitsm_agentdo not see the selector at all.

Table flag and properties
Set Is realm separated to Yes on a table’s Table definition to separate it. The table then gets two managed fields, System Realm and SystemRealmCIDR. Then set these table properties as needed. They are used mostly with the Realm hierarchy provider.
| Name | Value | Notes |
|---|---|---|
tenancy.filter_direction |
down, up or both. Default down. |
The direction a user sees along the tree from their selected realm, subject to the other visibility rules. |
realm.evaluate on a separated table |
A field path, for example Company.SystemRealm |
Sets the record’s realm from a field during normal processing, so no trigger is needed. |
realm.evaluate on a related table |
A relationship field name, for example Parent |
Takes the realm from the parent record, together with tenancy.sync_relations on the parent table. |
tenancy.sync_relations |
Relationship names, for example WorkTimeCards,RelatedSLA |
Copies the record’s realm to its related records, such as an incident’s SLAs and time cards. Without it, the related records get no realm unless a trigger sets one. Use it instead of a trigger. |
On a table hierarchy such as Work, ITSMWork and Incident, each table can have its own properties.
Scripts
| Name | Value | Notes |
|---|---|---|
RealmUtils.updateRealmCIDRsForAllTables() |
Returns true or false | Run it after an existing realm with children or records gets a new parent. It can affect performance, so run it out of hours, after the day’s realm changes. |
RealmUtils.renumberDownstreamInclusive(realmRecord) |
Returns nothing | Renumbers a realm and the realms below it after its parent changes. A queued job then corrects the realm fields on existing records. |
user.getCurrentTenantID() |
A realm ID | The realm the user selected in the realm selector, which can differ from their own. |
user.getPrimaryTenantID() |
A realm ID | The realm on the user’s own record. |
Table() and TableProtected() |
Table APIs | Table() ignores tenancy. TableProtected() applies it. Use TableProtected() in portal components so users see no more than they should. |