The process in which immunoglobulin genes are formed through recombination of the germline genetic elements, also known as immunoglobulin gene segments, within a single locus following the induction of and contributing to an immune response.