Seems that the code is still passing in -1 instead of null values for the @FixedInversionID value simply run the query below to update the stored procedure.
ALTER 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( @FixedInVersionId = -1)
set @FixedInVersionId = null
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()