Residual stress and cracks after welding are widespread mechanical defects in gas and oil pipelines. Internal pressures cause crack propagation and reduce the fatigue life of pipelines. This study developed a new procedure, based on an extended isogeometric analysis (XIGA) to investigate the effect of welding residual stress and cyclic internal pressure on the crack propagation rate and fatigue life. A new approach based on a thermo elastic-plastic equation is introduced for residual stress analysis. The fundamental aspect of this approach is determining the redistribution of residual stress while the crack is growing, and computing the stress intensity factor (SIF) in the residual stress field. Grid points around the crack surface and crack front are identified by the level set method. Then, discontinuous enrichment functions are added to the XIGA approximation. Thus, remeshing is not required in this method. The residual stress results calculated by the presented numerical method are in good agreement with the hole-drilling strain-gage method results. The interaction integral method was used to extract SIF. The superposition method was employed to consider the effect of welding residual stress and cyclic internal pressure on the SIF. Also, the modified Walker equation was used to calculate the fatigue life caused by cyclic internal pressure and welding residual stress. To validate the results, the same analysis was performed using the finite element method. The results of the presented method are in good agreement with finite element method (FEM) results.