I maintain a search index with all your Tickets.
Then when a commit comes in, I run a semantic search to pull up candidate tickets.
I then feed that to the prompt, and let the AI decide. The challenge is the index for sure, those params definitely still need tweaking.