Skip to main content

Linear

Port's Linear integration allows you to model Linear resources in your software catalog and ingest data into them.

Overview

This integration allows you to:

  • Map and organize your desired Linear resources and their metadata in Port (see supported resources below).
  • Watch for Linear object changes (create/update/delete) in real-time, and automatically apply the changes to your software catalog.

Supported Resources

The resources that can be ingested from Linear into Port are listed below.
It is possible to reference any field that appears in the API responses linked below in the mapping configuration.

Setup

Choose one of the following installation methods:

Using this installation option means that the integration will be hosted by Port, with a customizable resync interval to ingest data into Port.

Beta feature

The Hosted by Port option is currently in beta, and is still undergoing final testing before its official release.

Should you encounter any bugs or functionality issues, please let us know so we can rectify them as soon as possible.
Your help is greatly appreciated! ⭐

Live event support

Currently, live events are not supported for integrations hosted by Port.
Resyncs will be performed periodically every 1 hour by default (can be configured differently after installation), or manually triggered by you via Port's UI.

Therefore, real-time events (including GitOps) will not be ingested into Port immediately.
Support for live events is WIP and will be supported in the near future.

Installation

To install, follow the following steps:

  1. Go to the Data sources page of your portal.

  2. Click on the + Data source button in the top-right corner.

  3. Click on the relevant integration in the list.

  4. Under Select your installation method, choose Hosted by Port.

  5. Configure the integration settings and application settings as you wish (see below for details).

Application settings

Every integration hosted by Port has the following customizable application settings, which are configurable after installation:

  • Resync interval: The frequency at which Port will ingest data from the integration. There are various options available, ranging from every 1 hour to once a day.

  • Send raw data examples: A boolean toggle (enabled by default). If enabled, raw data examples will be sent from the integration to Port. These examples are used when testing your mapping configuration, they allow you to run your jq expressions against real data and see the results.

Integration settings

Every integration has its own tool-specific settings, under the Integration settings section.
Each of these settings has an ⓘ icon next to it, which you can hover over to see a description of the setting.

Port secrets

Some integration settings require sensitive pieces of data, such as tokens.
For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.

When changing such a setting, you will be prompted to choose an existing secret or create a new one:



Port source IP addresses

When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses.
You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:

54.73.167.226  
63.33.143.237
54.76.185.219

Configuration

Port integrations use a YAML mapping block to ingest data from the third-party api into Port.

The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.

Examples

To view and test the integration's mapping against examples of the third-party API responses, use the jq playground in your data sources page. Find the integration in the list of data sources and click on it to open the playground.

Additional examples of blueprints and the relevant integration configurations:

Team

Team blueprint
{
"identifier": "linearTeam",
"title": "Linear Team",
"icon": "Linear",
"description": "A Linear team",
"schema": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"description": "Team description"
},
"workspaceName": {
"type": "string",
"title": "Workspace Name",
"description": "The name of the workspace this team belongs to"
},
"url": {
"title": "Team URL",
"type": "string",
"format": "url",
"description": "URL to the team in Linear"
}
}
},
"calculationProperties": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: team
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"linearTeam"'
properties:
description: .description
workspaceName: .organization.name
url: "\"https://linear.app/\" + .organization.urlKey + \"/team/\" + .key"

Label

Label blueprint
{
"identifier": "linearLabel",
"title": "Linear Label",
"icon": "Linear",
"description": "A Linear label",
"schema": {
"properties": {
"isGroup": {
"type": "boolean",
"title": "Is group",
"description": "Whether this label is considered to be a group"
}
}
},
"calculationProperties": {},
"relations": {
"parentLabel": {
"target": "linearLabel",
"title": "Parent Label",
"required": false,
"many": false
},
"childLabels": {
"target": "linearLabel",
"title": "Child Labels",
"required": false,
"many": true
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: label
selector:
query: "true"
port:
entity:
mappings:
identifier: .id
title: .name
blueprint: '"linearLabel"'
properties:
isGroup: .isGroup
relations:
parentLabel: .parent.id
childLabels: "[.children.edges[].node.id]"

Issue

Issue blueprint
{
"identifier": "linearIssue",
"title": "Linear Issue",
"icon": "Linear",
"schema": {
"properties": {
"url": {
"title": "Issue URL",
"type": "string",
"format": "url",
"description": "URL to the issue in Linear"
},
"status": {
"title": "Status",
"type": "string",
"description": "The status of the issue"
},
"assignee": {
"title": "Assignee",
"type": "string",
"format": "user",
"description": "The user assigned to the issue"
},
"creator": {
"title": "Creator",
"type": "string",
"description": "The user that created to the issue",
"format": "user"
},
"priority": {
"title": "Priority",
"type": "string",
"description": "The priority of the issue"
},
"created": {
"title": "Created At",
"type": "string",
"description": "The created datetime of the issue",
"format": "date-time"
},
"updated": {
"title": "Updated At",
"type": "string",
"description": "The updated datetime of the issue",
"format": "date-time"
}
}
},
"calculationProperties": {},
"relations": {
"team": {
"target": "linearTeam",
"title": "Team",
"description": "The Linear team that contains this issue",
"required": false,
"many": false
},
"parentIssue": {
"title": "Parent Issue",
"target": "linearIssue",
"required": false,
"many": false
},
"labels": {
"target": "linearLabel",
"title": "Labels",
"required": false,
"many": true
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: issue
selector:
query: "true"
port:
entity:
mappings:
identifier: .identifier
title: .title
blueprint: '"linearIssue"'
properties:
url: .url
status: .state.name
assignee: .assignee.email
creator: .creator.email
priority: .priorityLabel
created: .createdAt
updated: .updatedAt
relations:
team: .team.key
labels: .labelIds
parentIssue: .parent.identifier

Alternative installation via webhook

While the Ocean integration described above is the recommended installation method, you may prefer to use a webhook to ingest data from Linear. If so, use the following instructions:

Note that when using the webhook installation method, data will be ingested into Port only when the webhook is triggered.

Webhook installation (click to expand)

In this example you are going to create a webhook integration between Linear and Port, which will ingest Linear issue entities.

Port configuration

Create the following blueprint definition:

Linear issue blueprint
{
"identifier": "linearIssue",
"title": "Linear Issue",
"icon": "Linear",
"schema": {
"properties": {
"url": {
"title": "Issue URL",
"type": "string",
"format": "url",
"description": "URL to the issue in Linear"
},
"status": {
"title": "Status",
"type": "string",
"description": "The status of the issue"
},
"assignee": {
"title": "Assignee",
"type": "string",
"format": "user",
"description": "The user assigned to the issue"
},
"creator": {
"title": "Creator",
"type": "string",
"description": "The user that created to the issue",
"format": "user"
},
"priority": {
"title": "Priority",
"type": "string",
"description": "The priority of the issue"
},
"created": {
"title": "Created At",
"type": "string",
"description": "The created datetime of the issue",
"format": "date-time"
},
"updated": {
"title": "Updated At",
"type": "string",
"description": "The updated datetime of the issue",
"format": "date-time"
}
}
},
"calculationProperties": {},
"relations": {}
}

Create the following webhook configuration using Port's UI

Linear issue webhook configuration
  1. Basic details tab - fill the following details:

    1. Title : Linear mapper;
    2. Identifier : linear_mapper;
    3. Description : A webhook configuration to map Linear issues to Port;
    4. Icon : Linear;
  2. Integration configuration tab - fill the following JQ mapping:

    [
    {
    "blueprint": "linearIssue",
    "entity": {
    "identifier": ".body.data.identifier",
    "title": ".body.data.title",
    "properties": {
    "url": ".body.data.url",
    "status": ".body.data.state.name",
    "assignee": ".body.data.assignee.email",
    "creator": ".body.data.creator.email",
    "priority": ".body.data.priorityLabel",
    "created": ".body.data.createdAt",
    "updated": ".body.data.updatedAt"
    }
    }
    }
    ]
  3. Click Save at the bottom of the page.

Create a webhook in Linear

You can follow the instruction in Linear's docs, they are also outlined here for reference:

  1. Log in to Linear as a user with admin permissions.
  2. Click the workspace label at the top left corner.
  3. Choose Workspace Settings.
  4. At the bottom of the sidebar on the left, under My Account, choose API.
  5. Click on Create new webhook.
  6. Input the following details:
    1. Label - use a meaningful name such as Port Webhook.
    2. URL - enter the value of the url key you received after creating the webhook configuration.
    3. Under Data change events - mark issues.
  7. Click Create webhook at the bottom of the page.
Linear events and payload

In order to view the different payloads and events available in Linear webhooks, look here

Done! any change you make to an issue (open, close, edit, etc.) will trigger a webhook event that Linear will send to the webhook URL provided by Port. Port will parse the events according to the mapping and update the catalog entities accordingly.

Let's Test It

This section includes a sample webhook event sent from Linear when an issue is created or updated. In addition, it includes the entity created from the event based on the webhook configuration provided in the previous section.

Payload

Here is an example of the payload structure sent to the webhook URL when a Linear issue is created:

Webhook event payload
{
"action": "create",
"actor": {
"id": "11c5ce7d-229b-4487-b23b-f404e4a8c85d",
"name": "Mor Paz",
"type": "user"
},
"createdAt": "2024-05-19T17:55:29.277Z",
"data": {
"id": "d62a755d-5389-4dbd-98bb-3db03f239d9d",
"createdAt": "2024-05-19T17:55:29.277Z",
"updatedAt": "2024-05-19T17:55:29.277Z",
"number": 5,
"title": "New issue again",
"priority": 0,
"boardOrder": 0,
"sortOrder": -3975,
"labelIds": [],
"teamId": "92d25fa4-fb1c-449f-b314-47f82e8f280d",
"previousIdentifiers": [],
"creatorId": "11c5ce7d-229b-4487-b23b-f404e4a8c85d",
"stateId": "f12cad17-9b8f-470d-b20a-5e17da8e46b9",
"priorityLabel": "No priority",
"botActor": null,
"identifier": "POR-5",
"url": "https://linear.app/getport/issue/POR-5/new-issue-again",
"state": {
"id": "f12cad17-9b8f-470d-b20a-5e17da8e46b9",
"color": "#e2e2e2",
"name": "Todo",
"type": "unstarted"
},
"team": {
"id": "92d25fa4-fb1c-449f-b314-47f82e8f280d",
"key": "POR",
"name": "Port"
},
"subscriberIds": [
"11c5ce7d-229b-4487-b23b-f404e4a8c85d"
],
"labels": []
},
"url": "https://linear.app/getport/issue/POR-5/new-issue-again",
"type": "Issue",
"organizationId": "36968e1b-496c-4610-8c25-641364da172e",
"webhookTimestamp": 1716141329394,
"webhookId": "ee1fa20e-6b57-4448-86f7-39d9672ddedd"
}

Mapping Result

The combination of the sample payload and the webhook configuration generates the following Port entity:

{
"identifier": "POR-5",
"title": "New issue again",
"team": [],
"properties": {
"status": "Todo",
"url": "https://linear.app/getport/issue/POR-5/new-issue-again",
"created": "2024-05-19T17:55:29.277Z",
"priority": "No priority",
"updated": "2024-05-19T17:55:29.277Z"
},
"relations": {
"labels": []
},
"icon": "Linear"
}