Last active
June 7, 2019 01:53
-
-
Save renatoch/e5c144be7c410ceea0e2 to your computer and use it in GitHub Desktop.
Get JIRA issue key and summary using chrome bookmark
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
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bvar issues %3D jQuery('.ghx-selected').filter('.js-issue').map(function(i%2C issue) %7Bvar k %3D jQuery(issue).attr("data-issue-key")%3Bvar s %3D jQuery(issue).find('.ghx-summary').attr("title")%3Breturn %7B key%3A k%2C summary%3A s%7D%7D).toArray()%3B%2F* copy issue from open issue *%2Fvar t %3D document.title.replace(" - JIRA"%2C "")%3Bvar match %3D t.match(%2F%5C%5B(.*)%5C%5D%2F)%3Bif (match) %7Bvar k %3D match%5B1%5D%3Bissues.push(%7B key%3A k%2C summary%3A t.replace("%5B" %2B k %2B "%5D "%2C "")%7D)%7D%2F* create list *%2Fvar links %3D jQuery.map(issues%2C function(i)%7Breturn "%5B" %2B i.key %2B "%5D " %2B i.summary%3B%7D)%3Bwindow.prompt ("Copy to clipboard%3A Ctrl%2BC%2C Enter"%2C links.join("%5Cr%5Cn"))%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment