Linear Integration
Automatically create Linear issues from Hardal analytics events using Linear’s GraphQL API.
Make sure to check the partner’s website and API documentation for the most up-to-date information and configurations.
Setup
Get Linear API Key
Go to Linear → Settings → Account → API → “Create Key” and copy the API key
Get Team ID
In Linear, open command menu (⌘/Ctrl+K) → “Copy model UUID” → Navigate to your team page → Copy the UUID
Add Destination
Go to Hardal dashboard → Marketing Destinations → “Add Custom Destination” → Select “Custom API” template
Configure Endpoint
{
"endpoint_url": "https://api.linear.app/graphql",
"request_method": "POST",
"content_type": "application/json"
}
Add Authentication
{
"headers": {
"Authorization": "Bearer YOUR_LINEAR_API_KEY"
}
}
Set GraphQL Query
{
"query": "mutation IssueCreate { issueCreate(input: { title: \"##event_name## from Hardal\", description: \"Event details: ##properties##\", teamId: \"YOUR_TEAM_ID\" }) { success issue { id title } } }"
}
Available Variables
##event_name## - Event name
##properties## - Event properties
##user_id## - User identifier
##page.url## - Current page URL
##created_at## - Event timestamp
##browser.name## - Browser name
##browser.version## - Browser version
Example Queries
NPS Response to Issue:
{
"query": "mutation IssueCreate { issueCreate(input: { title: \"NPS: ##properties.score## from ##properties.user##\", description: \"Score: ##properties.score##\\nFeedback: ##properties.feedback##\", teamId: \"YOUR_TEAM_ID\" }) { success issue { id title } } }"
}
Error to Bug Report:
{
"query": "mutation IssueCreate { issueCreate(input: { title: \"Bug: ##properties.error_message##\", description: \"Error: ##properties.error_message##\\nURL: ##page.url##\\nUser: ##user_id##\", teamId: \"YOUR_TEAM_ID\" }) { success issue { id title } } }"
}