1

There are some cases (such as when a case is opened via email) to modify the OpenedBy user from the default specified for that mailbox to something else.

Is changing the OpenedBy possible via the plugin API? We are using FogBugz 7.3.0

I have been (unsuccessfully) attempting to do this with the following:

if (people.Length == 1)
                {
                    // Pretty good chance this is a match!
                    e.bug.IgnorePermissions = true;
                    e.bug.ixPersonOpenedBy = people[0].ixPerson;

                    e.bug.Commit("Found that this probably submitted by : " + people[0].sFullName + " " + people[0].ixPerson);
                    e.bug.IgnorePermissions = false;
                }
flag

2 Answers

0

That looks like it ought to work; that property is modifiable, and the inner bug does commit it. Are you able to get in there with the debugger or by some other mechanism find the return value of the call to Commit?

link|flag
Seems like the return value from e.bug.Commit(.... is "168" The block of code above is executed within an on case opened event... is that an acceptable place to do this? – James Dio May 26 2010 at 12:43
0

I believe this has something to do with where I had the code above. I placed that in an OnCaseOpened bug commit event... when I attempted to change the OpenedBy person in BugCommitBefore I was able to alter the person who opened the case.

I don't know if that's a bug, or if it's working correctly -- but I have figured out how to accomplish what I was looking for.

Edit: The initial code was probably working all along. I believe the problem I was running into was that there are 3 BugCommitBefore calls during the opening of a case via email, and I was modifying it before FogBugz made a subsequent edit to the field..

link|flag

Your Answer

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