After commissioning, the ship underwent a lengthy work up process, which was common for German destroyers during the Second World War. Following "Z31" being damaged in a collision with a schooner on 6 November 1941, she was transferred to an operational flotilla in Norwegian waters in December 1942. On 30 December 1942, "Z31" left Altafjord in northern Norway along with the heavy cruisers and "Lützow" and the destroyers "Friedrich Eckoldt", "Richard Beitzen", "Theodor Riedel", and on Operation Regenbogen, an attempt to attack the Arctic convoy JW 51B. The German force encountered the convoy on the morning of 31 December, and in poor visibility, engaged the convoy's escort in the Battle of the Barents Sea. "Hipper" sank the British destroyer and the minesweeper and damaged the destroyers and , while "Lützow" damaged the destroyer , but broke off the engagement after the British cruiser covering force of and damaged "Hipper" and sank "Richard Beitzen". None of the 15 merchant ships in the convoy were damaged.