  We use neutron resonance spin echo and Larmor diffraction to study the effect
of uniaxial pressure on the tetragonal-to-orthorhombic structural ($T_s$) and
antiferromagnetic (AF) phase transitions in iron pnictides
BaFe$_{2-x}$Ni$_{x}$As$_{2}$ ($x=0,0.03,0.12$), SrFe$_{1.97}$Ni$_{0.03}$As$_2$,
and BaFe$_2$(As$_{0.7}$P$_{0.3}$)$_2$. In antiferromagnetically ordered
BaFe$_{2-x}$Ni$_{x}$As$_{2}$ and SrFe$_{1.97}$Ni$_{0.03}$As$_2$ with $T_N$ and
$T_s$ ($T_N\leq T_s$), a uniaxial pressure necessary to detwin the sample also
increases $T_N$, smears out the structural transition, and induces an
orthorhombic lattice distortion at all temperatures. By comparing temperature
and doping dependence of the pressure induced lattice parameter changes with
the elastoresistance and nematic susceptibility obtained from transport and
ultrasonic measurements, we conclude that the in-plane resistivity anisotropy
found in the paramagnetic state of electron underdoped iron pnictides depends
sensitively on the nature of the magnetic phase transition and a strong
coupling between the uniaxial pressure induced lattice distortion and
electronic nematic susceptibility.
