After each incident save, query existing titles with the same prefix
to find the real max number, then use max(dbMax, tplNum) + 1.
Prevents duplicate counters when incidents were created before the
template was configured.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>