Summary: ◀▼
You can create parent-child relationships between custom objects and standard objects to establish hierarchical data structures with inherited permissions and shared data. This setup improves data integrity by controlling child record lifecycles through the parent. You can also add roll-up summary fields to custom object parents to aggregate child record data, with filtering options to refine relationships and summaries based on specific criteria.
A parent-child relationship field is a type of custom field you can add to standard Zendesk objects and custom objects. It is used to define a hierarchical relationship between objects, and support inherited permissions and shared data. Additionally, within a parent-child relationship that has a custom object parent, admins can define roll-up summary fields that provide a read-only summary of a characteristic of child records.
If you're looking to create a non-hierarchical relationship between objects, see Creating and using lookup relationship fields.
Understanding parent-child relationships
Admins and agents with permission can add parent-child relationship fields to the child object in the relationship to establish a hierarchical parent-child relationship between objects in Zendesk. Child records can't exist outside of the context of the parent record. Therefore, the parent record has complete control over the lifecycle for the child records, especially as it relates to data deletion. Because of the strictness of the relationship, parent-child relationships can improve data integrity and predictability.
When creating the parent-child relationship field, you can select whether the child object should inherit the parent's permissions.
When agents work with parent-child relationships, the parent-child relationship field is a required field for the child object's records. From a parent object record, admins and agents with permission can view a list of child records.
Limitations
- Parent-child relationship fields are added to the child objects. Currently, only custom objects are supported as child objects.
- Parent-child relationship fields support tickets, users, organizations, and custom objects as parent objects. Parent-child relationships don't support articles, brands, or groups as the parent object.
- Each object can be configured as the child object for a maximum of two parent relationships.
- There is no limitation to the number of child objects a parent object can have.
- If an object is the child to more than one parent object, only one of the parent object's permissions can be inherited.
- Child objects can't be parents to other objects.
- Parent-child relationship fields can't be added if either object already has records.
- Deleting a parent record also permanently deletes all associated child records.
- Parent-child relationship fields can be deleted from the child object, but this action is permanent and results in the loss of all relationship data.
- Roll-up summary fields are supported for parent-child relationships with a custom object parent only.
- Roll-up summaries can summarize a maximum of 10,000 child records per field. If the parent has more than 10,000 child records, the roll-up summary can't be calculated.
Participating in the Parent-child relationships EAP
During the EAP, you must agree to the terms and conditions.
- In Admin Center, click
Objects and rules in the sidebar, then select Custom objects >
Objects. - Select Turn on early access to parent-child relationships and roll-up summaries.
- Agree to the EAP terms and conditions, anc click Get started.
Adding parent-child relationship fields
Parent-child relationship fields are added to child objects and displayed on their object's pages in Zendesk.
- In Admin Center, click
Objects and rules in the sidebar, then select Custom objects >
Objects. - Click the name of the custom object you want to add a field to.
- Click the Fields tab, and then click Add field.
- Select Parent-child.
- Set the Display name, Field key, and Description as described in Defining a custom object's schema with custom fields.
- Under Select a parent object, select ticket, users, organizations, or another custom object as the parent object for the relationship.
- (Optional) Select Inherit permissions from the parent object if you
want the child object to inherit the parent object's permissions.
When selected, the parent's permissions override any permissions defined for the child object.
Note: If this option isn't available, it means the object is already configured to inherit permissions from a different parent object. - (Optional) Click Add filter to define one or more filters to reduce
the number of options that the field can display.
In most cases, you'll want a defined subset of records for the options in your parent-child relationship fields. You can filter objects by any number of tags or custom fields. See Filtering a parent-child relationship field's options
- Click Save.
Filtering a parent-child relationship field's options
- Ticket: If the parent object is a ticket, the following additional default filters are available: Status, Type, Priority, Assignee, Requester, Form, Organization, and Channel.
- User: If the parent object is a user, there is an additional Role filter available.
- Custom object: If the child object is a custom object, you can dynamically restrict the object records available for selection within the parent-child field by using additional filters.
Relationship fields also support filtering by other custom fields added to the
related object. For example, if you add a Security Clearance custom
checkbox field to the user profile, the Security Clearance field will
appear as a filter option when you add the parent-child relationship field. You
could then define the following filter condition for the field: Security
Clearance | Is | Checked.
Furthermore, you can filter relationship fields based on whether they match or don't match field values in the source object. For example, if an object has a parent-child relationship field named Order category that points to a custom object named Order, you could filter the results to return only Order records that have a Category field value that matches the ticket's Order category field. When filtering parent-child relationship fields for matching values in one of the source object's fields, the tags (rather than values) are compared for drop-down fields.
When using the match and does not match
operators to filter relationship field values, you can only compare values in
fields of the same type. For example, two drop-down field values can be
compared, but you can't compare a drop-down field's value to a multi-select
field's value. Therefore these operators are only available when matching field
types exist.
You can modify the filters at any time. This won't affect the values previously selected within parent-child relationship fields.
Adding roll-up summary fields to parent objects
Roll-up summary fields provide a summary of a characteristic of child records on a parent record. For example, you may want the total cost the child line items within an order.
The roll-up summary custom field type is available only for parent-child relationships where the parent is a custom object. Roll-up summaries support a maximum of 10,000 child records to be summarized per field.
- If there are less than 1,000 child records being summarized, the roll-up summary is calculated in near real-time.
- If there are between 1,000 and 10,000 child records being summarized, the roll-up summary is calculated on an hourly basis.
- If there are more than 10,000 child records being summarized, the roll-up summary can't be calculated.
- In Admin Center, click
Objects and rules in the sidebar, then select Custom objects >
Objects. - Click the name of the parent object you want to add the field to.
- Click the Fields tab, and then click Add field.
- Select Roll-up summary.
- Set the Display name, Field key, and Description.
- Under Select summarized object, select the child object they want to summarize.
- Under Select roll-up type, select from: Count, Sum,
Min (minimum), and Max (maximum).
Sum is available for use with number, decimal, and currency field types. Min and max are available for use with date, number, decimal, and currency field types.
- Then use Select field to aggregate to specify the child object's field that you want to summarize.
- (Optional) Click Add filter to define one or more filters to reduce the number of child objects the roll-up field summarizes.
- Click Save.