Forked from mheiniger/jira-extract-issue-links-tab-separated-SP.js
Last active
July 2, 2018 09:41
-
-
Save CodeCommander/6b80a3bea770d8c1be0ed7920338cb99 to your computer and use it in GitHub Desktop.
Extract issues from Jira for copy&paste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the bookmarklet here: http://mrcoles.com/bookmarklet/ */ | |
/* This bookmarklet generates a markdown table */ | |
/* copy selected issues from agile planning lists */ | |
var issues = jQuery('.ghx-selected') | |
.filter('.js-issue') | |
.map(function(i, issue) { | |
var k = jQuery(issue).attr("data-issue-key"); | |
var s = jQuery(issue).find('.ghx-summary').attr("title"); | |
var type = jQuery(issue).find('.ghx-type').attr("title"); | |
var link = jQuery(issue).find('.js-key-link').attr("href"); | |
var estimate = jQuery(issue).find('.ghx-statistic-badge').text(); | |
return { key: k, summary: s, type: type, link: link, estimate: estimate} | |
}).toArray(); | |
/* copy issue from open issue */ | |
var t = document.title.replace(" - JIRA", ""); | |
var match = t.match(/\[(.*)\]/); | |
if (match) { | |
var k = match[1]; | |
issues.push({ key: k, summary: t.replace("[" + k + "] ", "")}) | |
} | |
/* create list */ | |
var host = window.location.protocol + "//" + window.location.hostname; | |
var header = "|Issue Type|Issue Number|Description|Estimate|\n|-|\n"; | |
var links = jQuery.map(issues, function(i){ | |
return "|" + i.type + "| [" + i.key + "](" + host + i.link + ")|" + i.summary + "|" + i.estimate + "|"; | |
}); | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", header + links.join("\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the bookmarklet here: http://mrcoles.com/bookmarklet/ */ | |
/* This bookmarklet uses tab delimiter and link as html */ | |
/* copy selected issues from agile planning lists */ | |
var issues = jQuery('.ghx-selected') | |
.filter('.js-issue') | |
.map(function(i, issue) { | |
var k = jQuery(issue).attr("data-issue-key"); | |
var s = jQuery(issue).find('.ghx-summary').attr("title"); | |
var type = jQuery(issue).find('.ghx-type').attr("title"); | |
var link = jQuery(issue).find('.js-key-link').attr("href"); | |
return { key: k, summary: s, type: type, link: link} | |
}).toArray(); | |
/* copy issue from open issue */ | |
var t = document.title.replace(" - JIRA", ""); | |
var match = t.match(/\[(.*)\]/); | |
if (match) { | |
var k = match[1]; | |
issues.push({ key: k, summary: t.replace("[" + k + "] ", "")}) | |
} | |
/* create list */ | |
var delimiter = String.fromCharCode(9); | |
var host = window.location.protocol + "//" + window.location.hostname; | |
var links = jQuery.map(issues, function(i){ | |
return i.type + ":" + delimiter + "<a href=\"" + host + i.link + "\">[" + i.key + "]</a>" + delimiter + delimiter + i.summary; | |
}); | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", links.join("\r\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the bookmarklet here: http://mrcoles.com/bookmarklet/ */ | |
/* This bookmarklet uses tab delimiter for pasting into google spreadsheets */ | |
/* copy selected issues from agile planning lists */ | |
var issues = jQuery('.ghx-selected') | |
.filter('.js-issue') | |
.map(function(i, issue) { | |
var k = jQuery(issue).attr("data-issue-key"); | |
var s = jQuery(issue).find('.ghx-summary').attr("title"); | |
var type = jQuery(issue).find('.ghx-type').attr("title"); | |
var link = jQuery(issue).find('.js-key-link').attr("href"); | |
var sp = jQuery(issue).find('.ghx-statistic-badge[title="Story Points"]').text(); | |
return { key: k, summary: s, type: type, link: link, sp: sp} | |
}).toArray(); | |
/* copy issue from open issue */ | |
var t = document.title.replace(" - JIRA", ""); | |
var match = t.match(/\[(.*)\]/); | |
if (match) { | |
var k = match[1]; | |
issues.push({ key: k, summary: t.replace("[" + k + "] ", "")}) | |
} | |
/* create list */ | |
var delimiter = String.fromCharCode(9); | |
var host = window.location.protocol + "//" + window.location.hostname; | |
var links = jQuery.map(issues, function(i){ | |
return i.type + ":" + delimiter + "[" + i.key + "]" + delimiter + host + i.link + delimiter + i.summary + delimiter + i.sp; | |
}); | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", links.join("\r\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the bookmarklet here: http://mrcoles.com/bookmarklet/ */ | |
/* This bookmarklet uses tab delimiter for pasting into google spreadsheets */ | |
/* copy selected issues from agile planning lists */ | |
var issues = jQuery('.ghx-selected') | |
.filter('.js-issue') | |
.map(function(i, issue) { | |
var k = jQuery(issue).attr("data-issue-key"); | |
var s = jQuery(issue).find('.ghx-summary').attr("title"); | |
var type = jQuery(issue).find('.ghx-type').attr("title"); | |
var link = jQuery(issue).find('.js-key-link').attr("href"); | |
return { key: k, summary: s, type: type, link: link} | |
}).toArray(); | |
/* copy issue from open issue */ | |
var t = document.title.replace(" - JIRA", ""); | |
var match = t.match(/\[(.*)\]/); | |
if (match) { | |
var k = match[1]; | |
issues.push({ key: k, summary: t.replace("[" + k + "] ", "")}) | |
} | |
/* create list */ | |
var delimiter = String.fromCharCode(9); | |
var host = window.location.protocol + "//" + window.location.hostname; | |
var links = jQuery.map(issues, function(i){ | |
return i.type + ":" + delimiter + "[" + i.key + "]" + delimiter + host + i.link + delimiter + i.summary; | |
}); | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", links.join("\r\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the bookmarklet here: http://mrcoles.com/bookmarklet/ */ | |
/* This bookmarklet uses space delimiter */ | |
/* copy selected issues from agile planning lists */ | |
var issues = jQuery('.ghx-selected') | |
.filter('.js-issue') | |
.map(function(i, issue) { | |
var k = jQuery(issue).attr("data-issue-key"); | |
var s = jQuery(issue).find('.ghx-summary').attr("title"); | |
var type = jQuery(issue).find('.ghx-type').attr("title"); | |
var link = jQuery(issue).find('.js-key-link').attr("href"); | |
return { key: k, summary: s, type: type, link: link} | |
}).toArray(); | |
/* copy issue from open issue */ | |
var t = document.title.replace(" - JIRA", ""); | |
var match = t.match(/\[(.*)\]/); | |
if (match) { | |
var k = match[1]; | |
issues.push({ key: k, summary: t.replace("[" + k + "] ", "")}) | |
} | |
/* create list */ | |
var host = window.location.protocol + "//" + window.location.hostname; | |
var links = jQuery.map(issues, function(i){ | |
return i.type + ": [" + i.key + "] " + host + i.link + " " + i.summary; | |
}); | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", links.join("\r\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment