Skip to content

Instantly share code, notes, and snippets.

@JoshuaSoileau
Last active November 15, 2017 14:14
Show Gist options
  • Save JoshuaSoileau/3bde42f8934054620a2aed4344a3bf22 to your computer and use it in GitHub Desktop.
Save JoshuaSoileau/3bde42f8934054620a2aed4344a3bf22 to your computer and use it in GitHub Desktop.
Parses out a new feature branch name for you, as long as you are viewing a jira task
// Parses out a new feature branch name for you, as long as you are viewing a jira task
// Create a new Bookmark, and use the code below as the URL (name can be anything)
javascript:(function(){String.prototype.replaceAll=function(search,replacement){var target=this;return target.replace(new RegExp(search,'g'),replacement)};var fullTitle=document.getElementById('summary-val').textContent.toLowerCase(),taskNumber=document.getElementById('key-val').textContent,titleArray=fullTitle.split('|').map(function(ele){return ele.trim()}),taskName=titleArray.pop().replaceAll(' ','-'),affectedTheme=titleArray.join('-').replaceAll(' ','-');var site=null;prompt('Copy to clipboard: Ctrl+C, Enter', 'feature/'+taskNumber+'__'+affectedTheme+'__'+taskName);}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment