Skip to content

Instantly share code, notes, and snippets.

@cobyan
Last active August 21, 2017 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cobyan/e41209719c576739b47a0ee71dd17c03 to your computer and use it in GitHub Desktop.
Save cobyan/e41209719c576739b47a0ee71dd17c03 to your computer and use it in GitHub Desktop.
Creates a formatted branch name from a Jira Issue Page
/**
* 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