1.6 KiB
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
- Load ticket + attachments (
include=attachmentsrefresh if needed) - Download PDF/image candidates (multi-URL fallback)
- Extract text:
pdftotext→ elsepdftoppm+tesseract - Heuristic
suggest_subject_from_text(doc type, person/company, date) - Queue drafts:
fieldssubject change (unless--no-queue-subject)- private
internal_notewith 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