Skip to content

Instantly share code, notes, and snippets.

@brad-jones
Created September 8, 2016 05: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 brad-jones/6e2db1831459b8a96690040062a8bbfd to your computer and use it in GitHub Desktop.
Save brad-jones/6e2db1831459b8a96690040062a8bbfd to your computer and use it in GitHub Desktop.
Bitbucket PR Userscript
// ==UserScript==
// @name bitbucket.com User Script
// @version 0.1
// @description Copies the source branch name into the PR Title.
// @author Brad Jones
// @include https://bitbucket.org/*
// ==/UserScript==
$(document).ready(function()
{
var updatePrTitle = function()
{
$('#id_title').val($('#id_source_group .select2-chosen').text());
};
if ($('#create-pullrequest').length > 0)
{
$('select.branch-field[data-field="source"]').on('change', updatePrTitle);
updatePrTitle();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment