Section 27. The district attorney who prosecuted such prisoners as are described in section twenty-three shall forward to the department of correction the criminal history of each prisoner as shown upon the trial, upon blanks to be furnished by the commissioner of correction.