Curious, but shouldn't this:
DECLARE noteID_curs CURSOR FOR
Select NoteID from BugNotes where BugID=@IncidentID and ProjectID=@ProjectID
come after this:
Select @ProjectID = (Select ProjectID from Inserted)
Select @IncidentID = (Select BugID from Inserted)
??