Skip to content

Instantly share code, notes, and snippets.

@jonathanbardo
Last active August 29, 2015 14:07
Show Gist options
  • Save jonathanbardo/2fa277c343af6b2837c5 to your computer and use it in GitHub Desktop.
Save jonathanbardo/2fa277c343af6b2837c5 to your computer and use it in GitHub Desktop.
Copy Jira issue
var title = document.title;
var endOfIssueKeyIndex = title.indexOf("]");
var issueKey = title.substring("[".length, endOfIssueKeyIndex);
window.prompt("Copy to clipboard: CMD+C, Enter", issueKey);
@jonathanbardo
Copy link
Author

For the bookmarklet:

javascript:(function()%7Bvar%20title%20%3D%20document.title%3Bvar%20endOfIssueKeyIndex%20%3D%20title.indexOf("%5D")%3Bvar%20issueKey%20%3D%20title.substring("%5B".length%2C%20endOfIssueKeyIndex)%3Bwindow.prompt("Copy%20to%20clipboard%3A%20CMD%2BC%2C%20Enter"%2C%20issueKey)%7D)()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment