Skip to content

Instantly share code, notes, and snippets.

@danactive
Last active September 18, 2017 04:11
Show Gist options
  • Save danactive/0fc13022cae675731bf0b3c0266ed454 to your computer and use it in GitHub Desktop.
Save danactive/0fc13022cae675731bf0b3c0266ed454 to your computer and use it in GitHub Desktop.
What changed in this PR? It's a basic changelog tool to extract Jira tickets from Bitbucket pull request. Tested on Atlassian Bitbucket v4.14.2. Requires jQuery v3
// 1) Add jQuery to page. One approach is to copy and paste the jQuery minified code into developer tool console
// 2) Paste this code into dev tool console
var messages = new Set();
$('.commit-row:not(.merge) .message-subject').each((index, cell) => {
const commitMessage = $(cell).text();
if (commitMessage.includes('JIRA-')) {
console.log(commitMessage);
messages.add(commitMessage.match(/JIRA-[0-9]{2,4}/g)[0]);
}
});
// 3) Read results
[...messages].join('\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment