Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
//Script by [[User:Animum]] that helps with adding permission templates to Image: and Talk: pages.
 
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Animum/urlparameters.js'
       + '&action=raw&ctype=text/javascript');
 
$(function() {
 if((wgCanonicalNamespace == "Talk" || wgCanonicalNamespace == "Image") && UrlParameters["action"] == "edit" && UrlParameters["otrspermission"] == 1) {
  var ticket = prompt("Ticket number:");
  document.editform.wpTextbox1.value = "{{PermissionOTRS\|id\=" + ticket + "}}\n" + document.editform.wpTextbox1.value;
  document.editform.wpMinoredit.checked = false;
  document.editform.wpWatchthis.checked = false;
  document.editform.wpSummary.value = "Adding [[Commons:OTRS|OTRS]] permission information";
  document.editform.submit();
 }
});
 
$(function() {
 if(wgCanonicalNamespace == "Image" || wgCanonicalNamespace == "Talk") {
  mw.util.addPortletLink("p-cactions", mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encodeURIComponent(mw.config.get('wgPageName')) + "&action=edit&otrspermission=1", "otrs", "ca-permissions");
 }
});