-
-
Save jasonmerino/46be4c64b18b179386b7 to your computer and use it in GitHub Desktop.
javascript:(function () { | |
function get(selector) { | |
try { | |
return document.querySelector(selector); | |
} catch(error) { | |
return {}; | |
} | |
} | |
var id = prompt('What\'s the JIRA for this pull request?'), | |
title = prompt('What change does this introduce?'), | |
sites = [ | |
'build', | |
'faucet', | |
'floormall', | |
'pullsdirect', | |
'handlesets', | |
'faucetdirect', | |
'ventingdirect', | |
'ventingpipe', | |
'lightingshowplace', | |
'lightingdirect' | |
], | |
pullInfo = | |
'### JIRA\nhttps://jira.impdir.com/browse/' + id.toUpperCase() + | |
'\n\n' + | |
'### Branch Builds \n'; | |
for (var i = 0; i < sites.length; i++) { | |
pullInfo += 'http://' + id.toLowerCase() + '.mbranch.' + sites[i] + '.com\n'; | |
} | |
get('#pull_request_body').value = pullInfo; | |
get('#pull_request_title').value = [id.toUpperCase(), title].join(' - '); | |
get('[name="issue[body]"]').value = pullInfo; | |
}()); |
javascript:(function () {
var id = prompt('Enter JIRA MOB number'),
issue = 'mob-' + id,
branchIssue = 'mob-' + (id.length === 3 ? '0' + id : id),
pullInfo =
'### JIRA\nhttps://jira.impdir.com/browse/' + issue +
'\n\n' +
'### Branch Builds \n' +
'http://' + branchIssue + '.mbranch.build.com\n'+
'http://' + branchIssue + '.mbranch.faucet.com\n' +
'http://' + branchIssue + '.mbranch.pullsdirect.com\n' +
'http://' + branchIssue + '.mbranch.handlesets.com\n' +
'http://' + branchIssue + '.mbranch.faucetdirect.com\n' +
'http://' + branchIssue + '.mbranch.ventingdirect.com\n' +
'http://' + branchIssue + '.mbranch.ventingpipe.com\n' +
'http://' + branchIssue + '.mbranch.lightingshowplace.com\n' +
'http://' + branchIssue + '.mbranch.lightingdirect.com';
document.getElementsByName('pull_request[body]')[0].value = pullInfo;
}());
javascript:(function () {
var id = prompt('Enter JIRA MOB number'),
issue = 'mob-' + id,
branchIssue = 'mob-' + (id.length === 3 ? '0' + id : id),
pullInfo =
'### JIRA\nhttps://jira.impdir.com/browse/' + issue +
'\n\n'+desc +
'### Branch Builds \n' +
'http://' + branchIssue + '.mbranch.build.com\n'+
'http://' + branchIssue + '.mbranch.faucet.com\n' +
'http://' + branchIssue + '.mbranch.pullsdirect.com\n' +
'http://' + branchIssue + '.mbranch.handlesets.com\n' +
'http://' + branchIssue + '.mbranch.faucetdirect.com\n' +
'http://' + branchIssue + '.mbranch.ventingdirect.com\n' +
'http://' + branchIssue + '.mbranch.ventingpipe.com\n' +
'http://' + branchIssue + '.mbranch.lightingshowplace.com\n' +
'http://' + branchIssue + '.mbranch.lightingdirect.com';
document.getElementsByName('pull_request[body]')[0].value = pullInfo;
}());