Skip to content

Instantly share code, notes, and snippets.

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 bigwhoop/529046 to your computer and use it in GitHub Desktop.
Save bigwhoop/529046 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Jira "Assign to me"
// @namespace *
// @include */CreateIssue.jspa
// ==/UserScript==
var target = document.getElementById('assignee');
if (target.parentNode.hasChildNodes) {
for (var i = 0; i < target.parentNode.childNodes.length; i++) {
var child = target.parentNode.childNodes[i];
if ('A' == child.nodeName) {
var str = child.getAttribute('onclick');
var matches = str.match(/value = '(.*)';/i);
document.getElementById('assignee').value = matches[1];
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment