Ted Cruz was Solicitor General of Texas when Rick Perry was Governor.
But, Cruz was Solicitor General of TX when GW Bush was Governor of TX.
Bush was Gov for 2 terms (I think), so Cruz might have been SG for only a few months before Bush got elected President.
I know Cruz did advise Bush during his campaign.