Skip to content

Instantly share code, notes, and snippets.

@jasonmerino
Last active August 29, 2015 14:02
Show Gist options
  • Save jasonmerino/46be4c64b18b179386b7 to your computer and use it in GitHub Desktop.
Save jasonmerino/46be4c64b18b179386b7 to your computer and use it in GitHub Desktop.
Github Pull Request Bootstrapper
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;
}());
@shawn-crossley
Copy link

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;
}());

@shawn-crossley
Copy link

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;
}());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment