1

1

Ninety percent of the time, when I respond to an email from within FogBugz, I hit the "Send & Close" button. Sometimes, however, a case is going to need additional work and I accidentally close the case instead of just sending the reply. Is there a way to disable the ability to resolve a case in certain scenarios?

flag

1 Answer

3

Here is some jQuery to remove resolve links:

$("input#Button_SendAndCloseEmail").remove();
$("a#resolve0").remove();
$("a#resolve1").remove();
$("a > img[src*='ico-resolve.gif']").remove();

You can use it in the following Bugmonkey script to disable case resolution options when a case is tagged "long-running." The tag will show up in yellow.

name:          Disable Resolve
description:   Disables the ability to resolve a case when it is tagged "long-running"
author:        Ben McCormack
version:       1.0.0.0

js:

   var isLongRunning = function() {
       return $.inArray('long-running',goBug.ListTagsAsArray()) >= 0;
   };
   var removeResolve = function() {
       $("input#Button_SendAndCloseEmail").remove();
       $("a#resolve0").remove();
       $("a#resolve1").remove();
       $("a > img[src*='ico-resolve.gif']").remove();   
   };
   var changeLongRunningTagColor = function() {
     var lr =  $(".tags a:contains('long-running')");
     if (lr.length !== 0)
     {
         lr.css("background-color","yellow");
     };
   };

   var doLongRunningCheck = function() {
       if (isLongRunning())
       {
           removeResolve();
           changeLongRunningTagColor();
       }
   };
   doLongRunningCheck();
   $(window).bind("BugViewChange", doLongRunningCheck);
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.