1

1

Possible Duplicate:
Prevent a case from being committed in a plugin

Hi Fogbugz:

I want to write a PlugIn to validate FixFor field, so if user chooses Undecided and wants to resolved that bug, the PlugIn will cancel that action, show warning message, and ask user to select the right FixFor.

Now I have to implement the IPluginBugCommit.BugCommitBefore method, the question is how to cancel current submit?

public void BugCommitBefore(CBug bug, BugAction nBugAction, CBugEvent bugevent,
            bool fPublic)
{
    /*If user select "Undecided" as current Milestone, not allow to resolved the bug.*/            
    if (bug.ixFixFor == 1 && nBugAction == BugAction.Resolve && bug.ixStatus == 2)
    {
        this.api.Notifications.AddError("Please Select the Milestone, Undecided is not allow.");
        //How to cancel current Resolved commit?
        //
     }
}

Have a good day.

AlarmChang.

flag
This amounts to requiring a field. Our philosophy would be to accept the edit, but assign the case back to the user asking them for a valid fixfor. fogbugz.stackexchange.com/questions/141/… – Rich Armstrong Dec 2 2010 at 13:58
please go vote for this feature request to show your support for allowing aborting bug commits: fogbugz.stackexchange.com/questions/1124/… – adambox Sep 15 at 19:59

closed as exact duplicate by adambox♦♦ Sep 15 at 19:58

1 Answer

1

Plugins cannot abort bug commit. See Rich's comment on your question above.

link|flag
These philosophical platitudes are getting tiresome. I understand the reasoning for having the core app not allowing fields to be marked required. However, when a user installs a plugin they are taking affirmative steps to override the standard app behavior at their own risk. How about a compromise where plug-ins that implement interfaces that violate the FogCreek way display a warning in the gallery, but still let them do what they need to do? – JohnFx Sep 13 at 21:40
@johnfx I have made the duplicate post into a proper feature request and added your feedback. Make sure to go vote it up. – adambox Sep 15 at 19:58

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