Last active
June 15, 2017 17:20
-
-
Save jacks0n/b51a2d6af8b76b4d6a27 to your computer and use it in GitHub Desktop.
Generate a Git branch name from a JIRA ticket's project and title slug.
This file contains 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
// Generated with http://chriszarate.github.io/bookmarkleter/ | |
javascript:!function(){var%20e=document.getElementById(%22key-val%22).text,t=document.getElementById(%22summary-val%22).textContent,a=t.trim().replace(%22+%22,%22and%22).replace(/[^a-z0-9+]+/gi,%22_%22),n=%22feature/%22+e+%22_%22+a;window.prompt(%22Copy%20to%20clipboard%22,n)}(); |
This file contains 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
var projectCode = document.getElementById('key-val').text, | |
ticketTitle = document.getElementById('summary-val').textContent; | |
var titleSlug = ticketTitle | |
.trim() | |
.replace('+', 'and') | |
.replace(/[^a-z0-9+]+/gi, '_') | |
var gitBranch = 'feature/' + projectCode + '_' + titleSlug; | |
window.prompt('Copy to clipboard', gitBranch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment