Hi,
I just wanted to share this information with others in case it is of interest. If you are wondering how new issues, sent by e-mail and received using BugNET's POP3 polling system, are created, it occurs in BugNET.BLL's IssueManager.cs module in the GetDefaultIssueByProjectId
function. What is important to know is that the [0] element is assumed to be the default for these:
var defCat = cats[0];
var defStatus = statuses[0];
var defPriority = priorities[0];
var defIssueType = issueTypes[0];
var defResolution = resolutions[0];
var defAffectedMilestone = affectedMilestones[0];
var defMilestone = milestones[0];
Populating the cats collection is the result of a stored procedure, defined in SqlDataProviderConstants.cs (under Library | Providers). There you will see a reference to "BugNet_ProjectCategories_GetCategoriesByProjectId". If you run that sp in SSMS
and pass in the project ID (get that by looking at the Projects table), then you will see your categories:
exec dbo.BugNet_ProjectCategories_GetCategoriesByProjectId 1
That stored procedure is returning Categories by CategoryName, which means that the Category ID that has a Name first in alphabetical order will be your "default" Category for new issues. In my case I had Enhancement Request, Question, and Suspected
Bug (probably not perfect choices, but I'm still testing) and therefore Enhancement Request is my default category for new issues coming in from POP3. I suspect that the other collections (Status, Priority, etc.) are also being alphabetized and the first item
in the list is being used as the default.
As a work-around, one thing to do is to rename your default category using a leading asterisk (*). For instance, if you want "Suspected Bug" to be the default then call it "*Suspected Bug".
I think an enhancement to these tables would be to have a bona-fide "Default" column of type Boolean/Bit so that a Value for a given project can be identified as the default value. Of course adding this later would potentially throw-off the existing
defaults but that can be explained in the upgrade notes.
Regards,
-- Jon