Skip to content

Instantly share code, notes, and snippets.

@jacoor
Last active December 18, 2020 17:33
Show Gist options
  • Save jacoor/4d0d259b79c8dec62a2859dcd0152cf0 to your computer and use it in GitHub Desktop.
Save jacoor/4d0d259b79c8dec62a2859dcd0152cf0 to your computer and use it in GitHub Desktop.
Bookmarklet to copy jira ticket # + title for easier commit creation. Just install this as a bookmarklet in your browser (tested in chrome) and use.
javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(document.title.split("]")[0].replace("[","")+" - "+document.getElementById("summary-val").textContent);
// this one simply copies ticket # + title and replaces all spaces with -, thus should be enough to copy this as branch name for git
javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(document.title.split("]")[0].replace("[","")+"-"+document.getElementById("summary-val").textContent.split(" ").join("-").split(":").join("-"));
@lhosio
Copy link

lhosio commented Dec 18, 2020

Didn't work on Firefox last time I checked, I'm back to Chrome and its good on that

@jacoor
Copy link
Author

jacoor commented Dec 18, 2020

forks welcome :P

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