Skip to content

Instantly share code, notes, and snippets.

@devinmancuso
Last active November 7, 2015 01:52
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 devinmancuso/890988b9852d47eda07b to your computer and use it in GitHub Desktop.
Save devinmancuso/890988b9852d47eda07b to your computer and use it in GitHub Desktop.
Inject defect reporting template into Jira bug ticket description textarea
javascript:(function(e,a,g,h,f,c,b,d){
if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){
c=a.createElement("script");
c.type="text/javascript";
c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";
c.onload=c.onreadystatechange=function(){
if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){
h((f=e.jQuery).noConflict(1),b=1);
f(c).remove()}};
a.documentElement.childNodes[0].appendChild(c)
}
})
(window,document,"1.3.2",function($,L){
$("textarea#description").val("
*Template:*\r\n
*Device:*\r\n
*Browser:*\r\n
*Element affected:*\r\n
\r\n
h3. Case 1\r\n
*Reproduce:* the necessary steps to reproduce the bug\r\n
#\r\n
#\r\n
\r\n
*Expected:* What was expected to happen from the specification\r\n
\r\n
*Actual:* What actually happened when you ran the test.\r\n
\r\n")
});
// Props to Ben Alman's bookmarklet boilerplate http://benalman.com/projects/run-jquery-code-bookmarklet/
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){ $("textarea#description").val("*Template:*\r\n*Device:*\r\n*Browser:*\r\n*Element affected:*\r\n\r\n h3. Case 1\r\n*Reproduce:* the necessary steps to reproduce the bug\r\n#\r\n#\r\n\r\n*Expected:* What was expected to happen from the specification\r\n\r\n*Actual:* What actually happened when you ran the test.\r\n \r\n")});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment