This is a bookmarklet for Jira and Git user. It generate branch name from an issue.
To use it, just drag and drop link bellow in your bookmark, go to a Jira issue, click on bookmark.
+Git branch name from Jira issue
raw code
(function(d) {
var a = document.createElement('div'),
b = document.createElement('span'),
sprint = '';
a.style = 'cursor:pointer;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;background:#FFF;z-index:999999;font-size:2em';
sprintNode = document.evaluate("//a[contains(@href, '/secure/GHGoToBoard.jspa?sprintId=')]/text()", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue !== null;
if ((jQuery('title').text().includes('ECBOW') || jQuery('title').text().includes('ECPEA')) && sprintNode) {
sprint = 'sprint-' + document.evaluate("//a[contains(@href, '/secure/GHGoToBoard.jspa?sprintId=')]/text()", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent.split('-')[1] + '/'
}
b.textContent = 'Click to copy to clipboard: ' + sprint + d;
a.append(b);
a.onclick = function(c) {
c = document.createElement('textarea');
var b = document.getSelection();
c.textContent = sprint + d;
document.body.appendChild(c);
b.removeAllRanges();
c.select();
document.execCommand('copy');
b.removeAllRanges();
document.body.removeChild(c);
document.body.removeChild(a)
};
document.body.append(a)
})(jQuery('title').text().replace(' - Jira', '').replace(/\[((RUN|ECBOW|ECPEA)-[\d]+)\] /g, '$1/').replace(/[^a-zA-Z0-9-/ ]/g, '').replace(/ /g, '-'));
To generate bookmarklet: Bookmarklet Maker with jQuery option