From 1904 until 1916, he assisted Cardinal Pietro Gasparri in his codification of canon law with the Department of Extraordinary Ecclesiastical Affairs.
Dari tahun 1904 hingga 1916, Pacelli membantu Kardinal Pietro Gasparri dalam kodifikasi (penyusunan) Hukum Kanon bersama Congregatio de Negotiis Ecclesiasticis Extraordinariis.