Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Nov 19, 2025

Create relationships

When you build a connector and add data to Teamwork Graph, creating relationships between your objects and other data in the graph is essential for unlocking the full value of that data. Relationships enable Teamwork Graph to "connect the dots" across different tools and data sources, making your data discoverable, actionable, and valuable in Atlassian experiences.

This guide explains why relationships matter and how to create them using the Teamwork Graph connector SDK.

Why create relationships

By defining relationships, you empower downstream features and integrations to deliver richer insights, automation, and user experiences, such as:

How to create relationships

There are two main approaches to creating relationships in Teamwork Graph:

Approach 1: Creating relationships via setObjects

When you ingest objects using setObjects, you can create relationships indirectly by including relationship attributes in the object payload:

  1. Through the parentKey and containerKey attributes, indicating a relationship between the ingested object and its parent or container.

  2. Through attributes that relate to a user, such as createdBy or owners.

  3. Through the associations attribute, which provides a way to generically link objects.

This approach is ideal when you're creating objects and their relationships in a single operation.

Approach 2: Creating relationships via setRelationships

You can also create relationships directly using the setRelationships method, which allows you to create or update relationships independently of object ingestion. This is useful when:

  • You need to create relationships between objects that already exist in the graph
  • You want to manage relationships separately from object creation
  • You need to create relationships in bulk without modifying the objects themselves

See the Relationship operations API reference for details on using setRelationships and deleteRelationship.

When to use each approach

Use caseRecommended approach
Creating objects and their relationships togetherUse setObjects with parentKey, containerKey, or associations
Creating relationships between existing objectsUse setRelationships
Managing relationships independently of objectsUse setRelationships
Updating or deleting specific relationshipsUse setRelationships or deleteRelationship
Creating hierarchical structures (parent-child)Use setObjects with parentKey or containerKey
Linking objects to Jira issuesUse setObjects with associations (for supported object types) or setRelationships

The following sections detail how to use setObjects to create relationships. For information about using setRelationships, see the Relationship operations documentation.

Parent and container

An object can have a parent or container defined through the parentKey or containerKey attribute. The type of this is equivalent - the Entity key.

For example, ingesting a Document object with a parent Document:

1
2
{
  id: document-1,
  parentKey: {
    type: 'atlassian:document',
    value: {
      entityId: document-2
    }
  }
}

While the API supports any object type being used as a parent or container, some combinations create defined relationships in the Teamwork Graph:

Object typeAssociation typeRelationship object typeRelationship created
BranchcontainerKeyatlassian:repositoryBranch in a repository
CommitcontainerKeyatlassian:repositoryCommit in a repository
DeploymentcontainerKeyatlassian:repositoryDeployment associated to a repository
MessagecontainerKeyatlassian:conversationConversation has a message
Pull requestcontainerKeyatlassian:repositoryPull request in a repository
CommentparentKeyatlassian:pull-requestPull request has a comment
DocumentparentKeyatlassian:documentParent document has a child document
MessageparentKeyatlassian:messageParent message has a child message

Associations

Relationships can be ingested through the associations property of an object to create a link between your object and another object.

For example, this list of associations creates a relationship between the ingested object and a Jira work item:

1
2
associations: {
  set: {
    associationType: "issueIdOrKeys",
    values: ["ABC-123"]
  }
}

The maximum number of associations for an object is 500.

Association types

Teamwork Graph supports the following association types:

Jira work items

An association type referencing work items in Jira.

PropertyTypeDescription
associationType"issueIdOrKeys"Defines the associationType as "issueIdOrKeys".
valueslist<String>List of Jira issueId or issueKeys. For example, 10001 or ABC-123

Teamwork Graph objects

An association type referencing another object you have sent. You do not need to ingest the object before you associate with it - a stub will be created in place, until the full object is ingested.

PropertyTypeDescription
associationType"atlassian:<objectType>"Defines the associationType as a specific object type, for example, atlassian:document.
valueslist<entityKey>List of Teamwork Graph object keys. For example:
1
2
{
  "entityId": "document-1"
}

Supported relationship types

Not all object types can be associated with another Teamwork Graph object type. At the moment, we only support the following use cases:

Object typeAssociation typeRelationship created
BranchissueIdOrKeysJira work item associated with a branch
Calendar eventatlassian:documentDocuments linked to a calendar event
Calendar eventissueIdOrKeysJira work item associated with a calendar event
CommitissueIdOrKeysJira work item associated with a commit
ConversationissueIdOrKeysJira work item mentioned in a conversation
Deploymentatlassian:deploymentDeployment associated with a deployment
Deploymentatlassian:commitDeployment contains a commit
DeploymentissueIdOrKeysJira work item associated with a deployment
DesignissueIdOrKeysJira work item associated with a design
DocumentissueIdOrKeysJira work item associated with a document
MessageissueIdOrKeysJira work item mentioned in a message
Pull requestatlassian:commitCommit belongs to a pull request
Pull requestissueIdOrKeysJira work item associated with a pull request

Rate this page: