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.