Linear Integration
Connect Hardal analytics to Linear for automated issue tracking
Linear Integration
Overview
This guide explains how to integrate Hardal analytics with Linear’s issue tracking system using Hardal’s Custom API integration. By connecting these platforms, you can automatically create Linear issues based on analytics events captured by Hardal, streamlining your workflow between user analytics and project management.
This integration leverages Linear’s GraphQL API to create issues directly from Hardal events.
Prerequisites
Before setting up the integration, ensure you have:
- A Hardal account with access to Marketing Destinations
- A Linear account with API access
- Linear API key or OAuth2 authentication configured
- A Linear Team ID where issues will be created
Setting Up Linear Authentication
Access Linear API Settings
- Log in to your Linear account
- Navigate to Settings > Account > API
Generate API Key
Click “Create Key” to generate a new personal API key
Copy API Key
Save this key securely (it will only be shown once)
Verify Permissions
Ensure your API key has sufficient permissions to create issues
Keep your API key secure! Never expose it in client-side code or public repositories.
Finding Your Linear Team ID
To create issues in the correct team, you need the Team ID:
Open Command Menu
In Linear, open the command menu (⌘/CTRL+K)
Select 'Copy model UUID'
Type “Copy model UUID” and select it
Navigate to Team Page
First navigate to your team’s page
Copy Team UUID
The copied value is your Team ID
Creating a Custom API Destination in Hardal
Access Destinations
- Go to your Hardal dashboard
- Navigate to Marketing Destinations
Add Custom Destination
Click “Add Custom Destination”
Select Template
Select “Custom API” from the templates
Configure Basic Settings
Fill in the following settings:
Setting | Value |
---|---|
Endpoint Label | Linear Integration |
Endpoint ID | linear-integration |
Endpoint URL | https://api.linear.app/graphql |
Request Method | POST |
Content Type | application/json |
Adding Authentication Headers
Add a header for Linear authentication:
Replace YOUR_LINEAR_API_KEY
with the API key you generated earlier.
Configuring the GraphQL Query
For the request format, you’ll need to use a GraphQL mutation:
Replace YOUR_TEAM_ID
with the Team ID you copied earlier. You can use Hardal variables like ##event_name##
and ##properties##
to dynamically insert data from events.
Example Use Cases
Example 1: NPS Responses to Linear Issues
This example creates a Linear issue whenever an NPS (Net Promoter Score) response is received:
Add a condition to only trigger this for NPS events:
- Event Name:
equals
-nps_response
Example 2: Error Events to Bug Reports
This example converts error events into Linear bug reports:
Add a condition:
- Event Name:
equals
-error_tracked
Example 3: Feature Requests from User Feedback
This example creates feature request issues from user feedback forms:
Add a condition:
- Event Name:
equals
-feature_request_submitted
Advanced Configuration
Assigning Issues to Team Members
To automatically assign issues to team members, include the assigneeId
field:
Setting Issue Priority
To set priority on Linear issues:
Linear priority values are 0 (no priority), 1 (urgent), 2 (high), 3 (medium), 4 (low).
Adding Labels to Issues
To add labels to your issues:
You’ll need to find the Label IDs using the same method as finding Team IDs.
Testing & Troubleshooting
Use Test Endpoint
Use the “Test Endpoint” button in Hardal to verify your configuration
Check Response
A successful response should contain {"data":{"issueCreate":{"success":true}}}
Verify in Linear
Check that the issue appears in your Linear workspace
Debug if Needed
If issues aren’t appearing, check the troubleshooting guide below
Common Issues and Solutions
Resources
Was this page helpful?