Use Triggers
I fell over this very short piece on triggers in iTerm
iTerm triggers can be used for converting text in your terminal to URLs and make them clickable. This is useful for creating JIRA issue links whenever there is a JIRA-1234 like pattern.
Go to iTerm -> Preferences
-> Profiles
-> Advanced
-> Triggers Edit
`
Check the official documentation for some insights
For now I have created triggers for my project directories so they change the title when I enter and leave.
The author of the piece I first mentioned, does neat trick with Jira issues. I do however not work with Jira in my iTerm, but the concept is neat and resembles what I do with a shortcut in my browser.