The invention provides the process illustrated in scheme 1 for synthesizing heterocyclic compounds of formula I.
In the process, an isothiocyanate of formula II is initially reacted with a primary amine or formula III to give a thiourea of formula IV. Subsequently, the thiourea of formula IV is converted to the corresponding heterocycle of formula I using a base and a sulfonyl chloride.