Automatically generates an ID for the investigation if not present.