Files
Jason Thistlethwaite 9ee9eb3ec6 Organized
2026-10-17 20:50:35 -04:00

1.6 KiB

Feature detail: OCR attachment → subject rename

Parent roadmap: ../features-for-redmine_tickets-sync
Status: MVP 2026-07-15
Module: redmine_ticket_ocr.py · CLI: ocr-rename

Intent

Scanned docs land in Helpdesk as tickets titled “Scanned document…”.
Ops need: open attachment → understand contents → rename subject (+ optional notes).

Commands

# One ticket: download OCR-able attachments, propose subject, queue private note (+ subject draft)
./bin/rtl ocr-rename --issue-id 12345

# Scan cache for generic scan subjects
./bin/rtl ocr-rename --where '@scanned-document' --only-generic-subjects --max-tickets 20

# Apply subject now (LAN/prod safety gates); still queues private OCR note by default
./bin/rtd ocr-rename --issue-id 12345 --apply-subject

# Extract only (no drafts)
./bin/rtl ocr-rename --issue-id 12345 --no-queue-subject --no-queue-note --json

Pipeline

  1. Load ticket + attachments (include=attachments refresh if needed)
  2. Download PDF/image candidates (multi-URL fallback)
  3. Extract text: pdftotext → else pdftoppm + tesseract
  4. Heuristic suggest_subject_from_text (doc type, person/company, date)
  5. Queue drafts:
    • fields subject change (unless --no-queue-subject)
    • private internal_note with OCR snippet (unless --no-queue-note)

Saved filter

saved-filters/scanned-document.expr → @scanned-document

Still open

  • Stronger LLM subject summarization (optional; keep heuristics default)
  • Cron wrapper that only processes new generic-scan tickets
  • HR-project default project config example