Created
July 6, 2010 12:33
-
-
Save todesking/465326 to your computer and use it in GitHub Desktop.
Set default values on creating Redmine ticket
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
// ==UserScript== | |
// @name redmine_set_default_values_on_new_ticket | |
// @namespace http://d.hatena.ne.jp/gnarl/ | |
// @include */issues/new* | |
// ==/UserScript== | |
(function() { | |
var SET_ASSIGNED_TO_IF_ONLY_ONE_USER=true; | |
var DEFAULT_TRACKER='2'; | |
var footer=document.getElementById('footer'); | |
if(!footer || !footer.childNodes[1] || footer.childNodes[1].href != 'http://www.redmine.org/') | |
return; | |
if(SET_ASSIGNED_TO_IF_ONLY_ONE_USER) { | |
var issue_assigned_to=document.getElementById('issue_assigned_to_id'); | |
var users=issue_assigned_to.getElementsByTagName('option'); | |
if(users.length==2) { | |
issue_assigned_to.value=users[1].value; | |
} | |
} | |
if(DEFAULT_TRACKER) { | |
var issue_tracker=document.getElementById('issue_tracker_id'); | |
issue_tracker.value=DEFAULT_TRACKER; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment