Inspiration
Jira issues carry more than text. People attach scans and photos of documents (invoices, contracts, forms, certificates, signed acts, printed reports) and screenshots of errors. Jira search cannot read any of them, and neither can an AI agent search them across issues: the facts are locked inside pixels. The same invoice or the same error is attached to several issues, and nobody can find it by what is written on the page, or tell that two issues in different projects are about the same document or the same problem. I wanted to make the text inside these images searchable, so support, finance, QA and engineering can find the issue behind a document, and see that an issue repeats something already handled, before anyone spends time on it.
What it does
Similar Issue Finder reads the text of the document scans (and screenshots) attached to Jira issues, as PNG, JPEG or PDF, and turns it into searchable context:
- Similar documents (issue panel). Finds the same page, a crop of it, or the same text (or error message) in other issues. It shows which words differ and lets you jump to the other issue in one click.
- Rovo agent, and an AI/OCR index for Rovo. Rovo can open the attachment of one issue, but it has no index of the text inside documents and scans, so it would have to open the issues one by one to find a document, which does not work on a large site. The app adds that index to the search of Rovo and of MCP clients: one call, the same ranked list as the search page. Ask in the Rovo chat for issues similar to an issue, or for issues whose documents and screenshots contain some words. The answer lists issues with links, status and the reason they match, as the asking user. An "Ask Rovo" button (with the Rovo icon) at the top of the panel, the search page and the admin page opens the chat with the agent: with a ready question in the panel, with an empty prompt on the other pages. The same two actions are also an MCP server (
rovo:mcp). - Document search (global page). Finds documents and screenshots by typed words, or by pasting/dropping another scan or screenshot. Exact text matches and semantic matches are combined into one ranking. The same words are also looked up in the summary and description of issues with JQL as the user, and a match in the text of the issue ranks higher than a match inside an image only.
Privacy by design. OCR, embeddings and vector search all run inside Forge. No document, screenshot or extracted text leaves the Atlassian platform, and no external LLM is called. Matches are re-checked as the viewing user, so issues they cannot see are never shown.
How we built it
Everything runs on Forge (Node.js, arm64) and integrates with Jira.
- Indexing. Jira issue events enqueue the issue. A queue consumer OCRs new PNG, JPEG and PDF attachments (Tesseract; the pages of a PDF are drawn as images by PDFium, a WebAssembly engine inside the app), keeps word-like tokens and error-message lines, and embeds the text and its four quarters with
all-MiniLM-L6-v2(ONNX). The 384-dimension vectors are stored in Forge SQL (TiDBVECTOR) throughforge-sql-ormand Drizzle. - Similar documents. Candidates come from
VEC_COSINE_DISTANCEover the chunk vectors of other issues. They are then re-scored by word overlap, crop containment, shared word pairs and shared error tokens, which gives a verdict: same, similar or different. - Search. SQL
LIKEand vector results are fused with Reciprocal Rank Fusion, and a cross-encoder (ms-marco-MiniLM-L6-v2, ONNX) then reads the query with the text of every candidate and drops what is found only by meaning and does not fit (a contract no longer shows up for a question about a hosting invoice). An uploaded scan or screenshot is OCR'd and matched exactly like an indexed one. - UI. Custom UI with React 19 and Atlassian Design System components.
Challenges we ran into
- Forge memory limits. OCR and the AI models are memory-hungry, so the app is one bundle split into eleven Forge functions. The panel resolver never loads the models, the heavy indexing runs in its own queue consumer, and the rerank model is loaded only when a search needs it.
- Native runtime and models. The ONNX runtime, the Tesseract worker and the model files cannot go through the Forge bundler. They are built separately as a sidecar, shipped through
extraFiles, and loaded lazily. - PDF without a native library. PDFium runs as WebAssembly inside the sidecar bundle: no native binary and no file to lose in the bundler. A page is drawn as an image and read like any scan, so a PDF made of text and a PDF that is only a scan work the same way.
- Matching crops. A small crop sits far from a whole page in embedding space. I embed the page and its four quarters, search a wide candidate set, and re-score by words.
- Noise. "Similar" alone is noisy (same app, same menu, a contract for a question about an invoice). A match must be strong, share the same error text, or pass a cross-encoder rerank before it is shown.
Accomplishments that we're proud of
- A complete OCR, embedding, vector-search and rerank pipeline running inside Forge, with no external services or LLM calls, built to be eligible for Runs on Atlassian.
- An AI/OCR index that Rovo and MCP clients search in one call. Rovo can open one attachment at a time, but has no index of the text inside documents.
- It is tested on real models, not only on mocks: 20 generated documents (invoices, contracts, a lab report, a boarding pass, error screenshots; PNG, JPEG and PDF, some as rough scans) go through the real OCR, the real indexer, the real search and the real rerank, and the tests check the exact results.
- Crops and partial scans find the full page they came from, and a rough scan (skewed, noisy) is taken for the same page as the clean one.
- Matches respect Jira permissions: they are loaded as the viewing user.
- One Custom UI serves both the issue panel, the global search page and the admin page.
What we learned
- Vectors alone are not enough for documents. Combining them with word-level signals (overlap, containment, error tokens) gave results that are far more useful than either alone.
- A cross-encoder rerank on top of the vector search removes the noise that a similarity threshold cannot, and it lets the vector stage be generous, which finds more documents.
- Forge SQL with
VECTORcolumns is enough for a practical similarity search without a separate vector database. - An agent that opens issues one by one does not replace an index: search is a different job from understanding, and the two work best together.
What's next for Similar Issue Finder: Documents & Scans
- More OCR languages, and reading the text layer of a PDF directly where there is one (today every PDF page is drawn and read with OCR, in English, up to 5 pages).
- Linking similar issues from the panel in one click (a
Relateslink, and a prompt to link when the same document is found in another issue). It needs write scopes in Jira, so the first version only reads and opens. - Removing a document from the index when its attachment or issue is deleted.
- Tuning the similarity and rerank thresholds on real scans and customer data.
Built With
- forge-async
- forge-realtime
- forge-sql
- forge-sql-orm
- onnx
- pdfium
- react
- rovo
- runs-on-atlassian
- tesseract
- typescript
- vite
