The pop3 email module is succesfully creating issues it is initially created with the default value for versionid of 0. that value does not exist in the DB and when I try to update the ticket it gives me an error:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/5/2008 4:05:44 PM
Event time (UTC): 2/5/2008 9:05:44 PM
Event ID: 03a3f3d152c244c98f36ecd85b0968b7
Event sequence: 207
Event occurrence: 13
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/BugNet-1-128467157477907564
Trust level: Full
Application Virtual Path: /BugNet
Application Path: D:\BugNET\
Machine name: xxxxxxxxxxxxx
Process information:
Process ID: 860
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Specified argument was out of the range of valid values.
Parameter name: versionId
Request information:
Request URL: http://rhqstgmon01/BugNet/Bugs/BugDetail.aspx?bid=15
Request path: /BugNet/Bugs/BugDetail.aspx
User host address: xxxx.xxx.xxx.xxx
User: xxxxx.xxxxx
Is authenticated: True
Authentication Type: Forms
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at BugNET.DataAccessLayer.GenericDataAccessLayer.GetVersionById(Int32 versionId)
at BugNET.BusinessLogicLayer.Version.GetVersionById(Int32 versionId)
at BugNET.BusinessLogicLayer.Bug.set_VersionId(Int32 value)
at BugNET.BugDetail.lnkUpdate_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
I dont have visual studio 2005 so i changed the stored proc that creates the issue (BugNet_Bug_CreateNewBug) and now it works. Depending on the projectid it will change the versionid to whatever value I want if the versionid = 0
CREATE PROCEDURE [dbo].[BugNet_Bug_CreateNewBug]
@Summary nvarchar(500),
@Description ntext,
@ProjectId Int,
@ComponentId Int,
@StatusId Int,
@PriorityId Int,
@VersionId Int,
@TypeId Int,
@ResolutionId Int,
@AssignedToUserName NVarChar(255),
@ReporterUserName NVarChar(255),
@DueDate datetime,
@FixedInVersionId int,
@Visibility int,
@Estimation decimal(4,2)
AS
DECLARE @newIssueId Int
-- Get Reporter UserID
DECLARE @AssignedToUserId UNIQUEIDENTIFIER
DECLARE @ReporterUserId UNIQUEIDENTIFIER
SELECT @AssignedToUserId = UserId FROM aspnet_users WHERE Username = @AssignedToUserName
SELECT @ReporterUserId = UserId FROM aspnet_users WHERE Username = @ReporterUserName
if @versionid = 0
Begin
select @versionid = case @projectid When 1 then 1 when 2 then 2 else @projectid end
end
INSERT Bug
(
Summary,
Description,
ReporterUserId,
ReportedDate,
StatusId,
PriorityId,
TypeId,
ComponentId,
AssignedToUserId,
ProjectId,
ResolutionId,
VersionId,
LastUpdateUserId,
LastUpdate,
DueDate,
FixedInVersionId,
Visibility,
Estimation
)
VALUES
(
@Summary,
@Description,
@ReporterUserId,
GetDate(),
@StatusId,
@PriorityId,
@TypeId,
@ComponentId,
@AssignedToUserId,
@ProjectId,
@ResolutionId,
@VersionId,
@ReporterUserId,
GetDate(),
@DueDate,
@FixedInVersionId,
@Visibility,
@Estimation
)
RETURN scope_identity()
GO