Section 10. A probation officer of a district court, in Boston, the municipal court of the city of Boston or the officer's official designee, when gathering information in accordance with section 85 of chapter 276, shall, at or prior to arraignment of a defendant on a criminal complaint, use best efforts to confirm the defendant's status as a veteran, as defined in clause Forty-third of section 7 of chapter 4, a person on active service in the armed forces of the United States, as defined in said clause Forty-third of said section 7 of said chapter 4 or a person with a history of military service in the armed forces of the United States.
The district courts, and in Boston, the municipal court of the city of Boston, shall have jurisdiction to divert to a program any person who is a veteran, as defined in said clause Forty-third of said section 7 of said chapter 4, on active service in the armed forces of the United States, as defined in said clause Forty-third of said section 7 of said chapter 4, or who has history of military service in the armed forces of the United States who is charged with an offense against the commonwealth for which a term of imprisonment may be imposed, regardless of age, who has not previously been convicted of a violation of any law of the commonwealth or of any other state or of the United States in any criminal court proceeding after having reached the age of 18 years, except for traffic violations for which no term of imprisonment may have been imposed, who does not have any outstanding warrants, continuances, appeals or criminal cases pending before any courts of the commonwealth or any other state or of the United States and who has received a recommendation from a program that such person would, in light of the capacities of and guidelines governing it, benefit from participation in said program.