Last active
June 2, 2021 18:30
-
-
Save adeolaawoyemi/590267f554fe1170a02687331fa3a824 to your computer and use it in GitHub Desktop.
Bookmarklet JavaScript for creating a git branch name from a Jira ticket in the format of `feature-TICKET-1234-some_desciption`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){function copyToClipboard(a){if(window.clipboardData&&window.clipboardData.setData)return clipboardData.setData("Text",a);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var b=document.createElement("textarea");b.textContent=a,b.style.position="fixed",document.body.appendChild(b),b.select();try{return document.execCommand("copy")}catch(a){return console.warn("Copy to clipboard failed.",a),!1}finally{document.body.removeChild(b)}}};copyToClipboard(('feature-' + document.querySelector('a#key-val.issue-link').innerText + '-' + document.querySelector('h1#summary-val.editable-field.inactive').innerText).replace(/ /g, '_').replace(/\[|\]|\.|'|"|>/g,''));})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment