[1.7.x] Added sphinx extension to ease generation of ticket links.

Backport of fca677fa43 from master