Escalate Freshdesk bug tickets to Linear issues

By General Input

Every 15 minutes, any Freshdesk ticket tagged as a bug is filed as a Linear issue and linked back, so engineering picks it up without support double entering.

Integrations

  • Freshdesk
  • Linear

Type

Deterministic Code

Categories

  • Customer Support
  • Engineering

Build me a code workflow that runs on a cron every 15 minutes and escalates new Freshdesk bug tickets into Linear issues, then closes the loop back on the Freshdesk ticket so it never gets escalated twice.

Step 1. Find new bug tickets. Call Freshdesk Filter Tickets with a Lucene-style query that matches open tickets tagged as bugs that have not already been escalated. Use a query like tag:"bug" AND status:2 AND NOT tag:"escalated-to-linear" (status 2 is Freshdesk's "open"). Page through results if there are more than 30.

Step 2. For each matching ticket, call Freshdesk View Ticket to load the full body and requester information. Include the requester so we have their name and email.

Step 3. Create a Linear issue with Linear Create Issue. Use the Freshdesk ticket subject as the issue title. The description should be Markdown and include: the ticket body, the requester's name and email, and a link back to the Freshdesk ticket in the form https://<subdomain>.freshdesk.com/a/tickets/<ticketId>. Map priority as urgent -> 1, high -> 2, medium -> 3, low -> 4 (Linear priorities: 0 No Priority, 1 Urgent, 2 High, 3 Normal, 4 Low). Let the user configure which Linear team the issue goes into when they set the workflow up.

Step 4. Close the loop on Freshdesk in two calls. First, call Freshdesk Add Note to Ticket with private set to true and a short body containing the new Linear issue URL, so agents can see the link but the customer cannot. Second, call Freshdesk Update Ticket to add the tag "escalated-to-linear" to the existing tags array (do not overwrite the current tags, merge into them). This guard tag is what the Filter Tickets query in Step 1 excludes, so the same ticket cannot be escalated twice.

Requirements: this is a deterministic code workflow, not an agent. Iterate over the matched tickets in a plain loop. If Linear Create Issue fails for one ticket, keep going with the others and log the error rather than halting the whole run. Do not add the escalated-to-linear tag or the note unless the Linear issue was actually created.

Inputs the user should be able to configure: the Linear team (required), an optional Linear label to apply to all created issues, the cron cadence (default every 15 minutes), and optionally the Freshdesk tag that means "bug" in case a team uses a different label.

Related prompts

Explore more prompts
Catch feature flags that never got switched on in productionWeekly alert noise review board for incident.io on-callMorning triage board for your Kernel browser agent runsTrack every half finished LaunchDarkly rollout in one boardFind the customers stuck contacting support again and againTurn shipped Linear work into Intercom product announcementsVoice agent QA review board for your Hume EVI callsClose the loop between Front tickets and Linear bug fixesOpen a Heroku release war room the moment production looks wrongFind the themes Help Scout tags miss and file them in Linear