Links
Links allow you to create organization-specific relationships between any two objects in DevRev. This feature enables you to define meaningful connections with custom names that reflect your business processes.
This section provides an overview of links and walks you through the process of creating and managing them. By the end of this section, you’ll be able to:
- Define link types
- Create links between objects
- List link types
- Update link types
- Deprecate link types
Concepts
Link type
A link type defines a relationship between two types of objects. It specifies:
- The source object types that the link initiates from
- The target object types that the link can be created to
- A forward name describing the relationship from source to target
- A backward name describing the relationship from target to source
Supported object types
Links can be created between the following object types:
- custom object
- work (issue, ticket, task, opportunity)
- account, user
- part (product, capability, feature, enhancement)
For more details on customization or custom object concepts, please refer to the documentation below:
Create link types
Let’s say you want to establish a parent-child relationship between tickets and a custom object type called “Campaign”. This relationship helps track which tickets are assigned to which campaigns.
To create this relationship, make an API call to create a link type:
The link type above defines:
- A descriptive name
- Source types that the link can be created from (ticket)
- Target types that the link can be created to (campaign custom object)
- Forward name (“is parent of”) describing the relationship from ticket to campaign
- Backward name (“is child of”) describing the relationship from campaign to ticket
Create links between objects
Once you have defined a link type, you can create links between objects:
When creating a link:
- Set
link_type
to"custom_link"
- Provide the link type ID in
custom_link_type
- Ensure both source and target objects exist
List link types
You can list link types in your organization, with optional filtering:
Update link types
Now, you want to expand the source types to allow both issues and tickets to have this relationship with campaigns.
You can update the existing link type to include additional source types:
Create links between objects with subtypes
You may want to restrict links to specific subtypes of objects. For example, only allowing issues of a particular subtype to be linked to tickets.
This configuration:
- Allows issues of subtype “social_media” to be linked to tickets
- Rejects attempts to link issues with no subtype or with other subtypes
The subtype should exist for the corresponding source type.
To add more valid source subtypes, use the update endpoint to add them to the source_types
array.
Deprecate link types
Link types cannot be deleted, only deprecated. This ensures that existing links maintain referential integrity and prevents data corruption.
To deprecate a link type, use the update endpoint and set deprecated
to true
: