How to switch NEEDINFO in bugzilla?

M

Matej Cepl

Hi,

still struggling with greasemonkeying RedHat bugzilla and I am not able
to switch programatically status of the bug to NEEDINFO (to Reporter).
See this piece of script (whole thing is available on http://
www.ceplovi.cz/matej/tmp/bugzillaCopyOwnerToCC.user.js ):

function needinfoHandler(evt) {
/** set bug to NEEDINFO reporter.
*/
var sel = document.forms[1].elements.namedItem("newstatus");
var statesList = [];
var state = "";

for (var i=0; i < sel.length; i++) {
state = sel.getAttribute("value");
state = state.replace(/\s*(.*)\s*/,"$1");
statesList[statesList.length] = state;
}
var stateIndex = statesList.indexOf("needinfo");
var selectedState = sel.getElementsByTagName("option") [stateIndex];

document.getElementById("knob-leave").checked = false;
document.getElementById("knob-changestatus").checked = true;
// myToggleNeedinfo(document.forms[1]);
unsafeWindow.toggleNeedinfo(document.changeform);
GM_log("after");

// for testing purpose to avoid actual commit of the form
evt.stopPropagation();
evt.preventDefault();
return false;

selectedState.selected = true;

var newOptions = document.getElementById("requestee_actor-16");
GM_log(newOptions);
var newOptionList = newOptions.getElementsByTagName("option");

var newOptionReporter = pickElement(newOptionList,
function(elem) {
return elem.innerHTML.test(/Reporter/);
});

}

Even when using unsafeWindow (there shouldn't be any security problem
with that -- after all, it is my employer's bugzilla) I cannot make the
switch to NEEDINFO correct.

Because, I expect that you don't get the same scripts as I (common users
get much more bland page), I uploaded an example page on http://
www.ceplovi.cz/matej/tmp/bugzilla-example.html .

Do you see anything how to make the switch, please?

I tried this on greasemonkey NG, but got no answer, will any Javascript
guru be able to help me here?

Thanks a lot for any answer,

Matej Cepl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top