At my work we use JIRA for issue tracking, and the FishEye plugin to integrate with our source control system. This means that for each commit against an issue we need to start our commit message with details of the issue so that JIRA/FishEye can pick it up. For example:
DAVE-1234 (Pairing with Dave is annoying) * Updated code to crash while Dave is around, so pairing can finish.
The title of the JIRA page for an issue has all the information we need:
[#DAVE-1234] Pairing with Dave is annoying - Your JIRA Instance Name
var title = document.title; var endOfIssueKeyIndex = title.indexOf("]"); var endOfIssueNameIndex = title.lastIndexOf(" - "); var issueKey = title.substring("[#".length, endOfIssueKeyIndex); var issueName = title.substring(endOfIssueKeyIndex + "] ".length, endOfIssueNameIndex); window.alert(issueKey + " (" + issueName + ")");
If you prefix that with
FireFox reformats the bookmark location automatically, but here is what you end up with for completeness’ sake: