# How do we attach codebase context to every new Linear or Jira ticket automatically?


URL: https://getunblocked.com/answers/attach-codebase-context-new-linear-jira-ticket/
Published: 2026-11-26T18:30:00Z
Updated: 2026-11-25T12:28:38Z
Author: Dennis Pilarinos
Categories: Context Engine, Engineering Insights

**Short answer:** Trigger a research call on every new ticket and post the result as one comment. With Unblocked, a Routine triggered by a new Linear issue asks where the code lives, what changed there, what was fixed before and who owns it, then comments with cited links. For Jira, an automation rule or webhook calls the Unblocked API or CLI and does the same.

---
To attach codebase context to every new Linear or Jira ticket, run one research call when the ticket is created and post the answer as a single comment. The comment names the likely code area, recent changes there, earlier fixes for the same symptom and the people who own that code. With Unblocked, the simplest version is a Routine set to fire when a new Linear issue is created: it researches the issue across code, pull requests, past tickets and Slack, then comments with what it found and links to each source. For Jira, an automation rule or webhook calls the Unblocked API or CLI instead. **Ticket enrichment** is this step of adding the context an engineer would otherwise dig up by hand. Teams we work with run it on new tickets in Linear, Jira and Asana so a person or an agent can act on them.

## Three ways to trigger it

| Trigger | Best for | What you build |
| --- | --- | --- |
| Unblocked Routine on a new Linear issue | Linear teams | Nothing beyond the instructions |
| Jira automation rule or tracker webhook calling the Public API | Jira, or Linear with custom filtering | A rule, or a small receiver service |
| Script or scheduled job calling the CLI | Asana, batch sweeps, CI | A short script |


**A Routine on a new Linear issue.** **A Routine** is an Unblocked automation that runs on a schedule or on an event and acts on what it finds. Routines can start "when an issue is created or a label is added" in a Linear workspace you choose. Each run "receives the triggering issue as context, and the routine can comment on that issue," and the built-in Triage new issues template "adds relevant context to each new issue as a comment" ([Unblocked docs](https://docs.getunblocked.com/routines.md)). Other teams we work with use this setup. You can limit it to one label, such as `bug`. It needs the Unblocked workspace app, not a personal Linear connection.

**A webhook calling the Public API.** Routines list no Jira trigger today. Jira automation has a [Work item created](https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/) trigger, and its Send web request action "sends an outgoing web request to notify another system" and can return response data for a later step ([Atlassian](https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/)). Point it at a service that calls Unblocked's Research Context endpoint, which "returns a synthesized summary along with the sources that support it" ([Unblocked API reference](https://docs.getunblocked.com/api-reference/context/research-context.md)), then posts the comment through the Jira API. Linear webhooks also fire when issues are created ([Linear developers](https://linear.app/developers/webhooks)).

**An automation calling the CLI.** `unblocked context-research --query "..." --instruction "..."` returns JSON with a summary and sources ([Unblocked CLI docs](https://docs.getunblocked.com/unblocked-cli/cli-query.md)). In cron or CI it signs in with an API token. Use it for Asana, whose webhooks report when a task is "added" ([Asana developers](https://developers.asana.com/docs/webhooks-guide)), or for an hourly sweep of new tickets.

## What to ask about each ticket

Keep 2 to 4 fixed questions so every comment has the same shape. For example:

- Which repository and files most likely handle the behavior this ticket describes?
- What changed in that code recently, and which pull requests did it?
- Has this symptom been reported or fixed before, and what was the fix?
- Who has worked on this code most, and which team owns it?

The code-area question matters most. In a June 2026 study on SWE-bench Verified, telling three repair models which files to change raised the pooled share of issues resolved from 44.7% to as much as 49.1% with predicted file lists, and 52.4% with the correct files ([Al Awad and Ivanov, arXiv](https://arxiv.org/abs/2606.30963)). Ask the engine to cite each claim and to say "nothing found" rather than guess. One team we work with runs this on every engineering ticket. A customer told us about a sprint-planning version: before planning, it attaches the relevant repositories, the history of the area and a short list of root-cause candidates to each ticket in the sprint.

## Where to post it, and how to stay out of the reporter's way

Don't rewrite the description, change fields or reassign the ticket.

**An internal comment** is one your team can read and the reporter or customer cannot. In Jira Service Management, Add internal note makes a comment "visible to service space team members only" ([Atlassian](https://support.atlassian.com/jira-service-management-cloud/docs/talk-to-the-customer-or-service-project-team-members/)). In Jira automation, the Comment on work item action lets you set the comment visibility ([Atlassian](https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/)). Linear's docs describe no internal comment type, so keep the comment short and label it as automated.

- Put the one-line answer first, then the links.
- Say when to stay quiet. The Routines docs advise telling event-triggered routines "which events don't need a response" ([Unblocked docs](https://docs.getunblocked.com/routines.md)).
- One comment per ticket, at creation, never on edits.

Check access before you turn it on. A Routine "runs as the team member who created it, using that person's permissions," so results may reach people who could not otherwise see them ([Unblocked docs](https://docs.getunblocked.com/routines.md)). A team API token can read everything in the sources chosen for it, and Data Shield filters answers for people, not for bots. Limit the routine or token to the repositories and channels the ticket's readers should see. For support queues, our answer on [telling a bug from expected behavior](https://getunblocked.com/answers/support-triage-bug-or-expected-behavior/) covers the human checks that should follow.

## What Linear and Atlassian already do

Linear's Triage Intelligence assesses each issue entering triage "against the rest of your data" and suggests teams, projects, assignees, labels and likely duplicates. It is on Business and Enterprise plans ([Linear docs](https://linear.app/docs/triage-intelligence)). Linear's Loops can also run on issues entering triage, and with code access set to Read, a loop can "inspect code and pull requests" ([Linear docs](https://linear.app/docs/loops)).

In Jira, Rovo can summarize a work item, find and link similar work items, and suggest related Confluence pages ([Atlassian](https://support.atlassian.com/organization-administration/docs/atlassian-intelligence-features-in-jira-software/)). A Jira automation rule can also prompt a Rovo agent and send its reply to an Add comment step ([Atlassian](https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/)).

If routing and duplicates are your main problem, start there. Triage Intelligence works from Linear data. Loops can also read public Slack channels and MCP connectors you set up ([Linear docs](https://linear.app/docs/loops)). A context engine is built for the research step: it [ranks code, pull requests, Slack and docs together](https://getunblocked.com/blog/inside-the-unblocked-context-engine/) and cites each source. See [Unblocked Routines that investigate issues](https://getunblocked.com/blog/routines/).

## Limits to plan for

The comment is a starting point. It may point to the wrong service when two share a name, and it misses fixes nobody wrote down. Check the links before acting. Our guide to [context for support and ops agents](https://getunblocked.com/blog/context-for-support-and-ops-agents/) covers what else an agent needs.

Use a small test setup first: one team or one label for 2 weeks. Then ask the engineers who got those tickets whether it helped. If they skip it, keep only the question they used.

## Read more

- [Introducing Unblocked Routines](https://getunblocked.com/blog/routines/)
- [Context for Support and Ops Agents: One Source for Every Agent You Run](https://getunblocked.com/blog/context-for-support-and-ops-agents/)

## Related answers

- [What enterprise search works for a 50 to 300 person engineering team when Glean feels like too much?](https://getunblocked.com/answers/enterprise-search-mid-size-engineering-team/)
- [How do we cut ramp-up time for engineers joining a large existing codebase?](https://getunblocked.com/answers/cut-ramp-up-time-large-codebase/)
- [How do I give Claude Code docs for our internal SDK that isn't on the public internet?](https://getunblocked.com/answers/claude-code-docs-internal-sdk/)
- [Which AI assistants answer engineering questions in Slack with links to their sources?](https://getunblocked.com/answers/ai-assistant-engineering-questions-slack-sources/)
