Last active
August 21, 2017 08:43
-
-
Save cobyan/e41209719c576739b47a0ee71dd17c03 to your computer and use it in GitHub Desktop.
Creates a formatted branch name from a Jira Issue Page
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
/** | |
* Creates a formatted branch name from a Jira Issue Page | |
* | |
* When properly executed as a bookmarklet on a Jira Issue Page, | |
* this script will output in your console a preformatted text | |
* which can be used as a branch name for your developing purposes | |
*/ | |
var prefix = 'your-prefix-here'; | |
var formattedBranchName = function() { | |
var issueId = document.getElementById('key-val').innerText; | |
var issueTitle = document.getElementById('summary-val').innerText.replace(/[^0-9A-z-]/g,'.'); | |
console.log(`${prefix}${issueId}_${issueTitle}`); | |
}; | |
formattedBranchName(); | |
alert('copy/paste from console.log'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment