Make JIRA Ticket Links Open Detailed View

Clicking a ticket id on a board opens the detailed ticket view in a new tab

  1. // ==UserScript==
  2. // @name Make JIRA Ticket Links Open Detailed View
  3. // @namespace chriskim06
  4. // @description Clicking a ticket id on a board opens the detailed ticket view in a new tab
  5. // @include https://*jira*com/secure/*Board*
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  7. // @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=19641
  8. // @version 1.1.3
  9. // @grant none
  10. // @locale en
  11. // ==/UserScript==
  12.  
  13. this.$ = this.jQuery = jQuery.noConflict(true);
  14.  
  15. $(function() {
  16.  
  17. waitForKeyElements(".js-key-link", addOnClick);
  18.  
  19. function addOnClick(jNode) {
  20. var url = window.location.href.match(/https:\/\/.*jira.*com/g)[0];
  21. jNode.on('click', function(e) {
  22. var link = url + jNode.attr('href');
  23. if (e.metaKey || e.ctrlKey || e.shiftKey) {
  24. window.open(link, '_blank');
  25. } else {
  26. window.location.href = link;
  27. }
  28. return false;
  29. });
  30. }
  31.  
  32. });