Revised Standard Version and Good News Translation include a footnote on this verse to indicate that they are following the Septuagint for part of the verse. The Hebrew really does not make sense here, and we recommend following Revised Standard Version and Good News Translation.
King Asa: Translators can have “King Asa of Judah.”
Made for defense against Baasha: King Asa of Judah had dug this cistern so the people of Judah could have an ample water supply while being besieged by Baasha. Hence the Good News Translation rendering is “dug when he was being attacked by King Baasha.”
Quoted with permission from Newman, Barclay M. and Stine, Philip C. A Handbook on Jeremiah. (UBS Helps for Translators). New York: UBS, 2003. For this and other handbooks for translators see here .
