Jehoshaphat is nearly killed when it turns out the Syrian strategy is to specifically target the man who has defeated them twice already, and Jehoshaphat is the only one looking the part. Chronicles reveals that it is God who intervenes to save him, while at the same time causing a random arrow to find its target between the joints of Ahab's armor, in the middle of his back.
When Jehoshaphat returns to Jerusalem, he is met by Jehu (son of Hanani), the same prophet God had sent to Israel's king Baasha more than 30 years earlier (1 Kings 16:1-7 1 Kings 16:1-7  Then the word of the LORD came to Jehu the son of Hanani against Baasha, saying,
 For as much as I exalted you out of the dust, and made you prince over my people Israel; and you have walked in the way of Jeroboam, and have made my people Israel to sin, to provoke me to anger with their sins;
 Behold, I will take away the posterity of Baasha, and the posterity of his house; and will make your house like the house of Jeroboam the son of Nebat.
 Him that dies of Baasha in the city shall the dogs eat; and him that dies of his in the fields shall the fowls of the air eat.
 Now the rest of the acts of Baasha, and what he did, and his might, are they not written in the book of the chronicles of the kings of Israel?
 So Baasha slept with his fathers, and was buried in Tirzah: and Elah his son reigned in his stead.
 And also by the hand of the prophet Jehu the son of Hanani came the word of the LORD against Baasha, and against his house, even for all the evil that he did in the sight of the LORD, in provoking him to anger with the work of his hands, in being like the house of Jeroboam; and because he killed him.
American King James Version×). It was Jehu's father, Hanani, who had been imprisoned by Jehoshaphat's father Asa for correcting him about not relying on God in his dealings with Syria (2 Chronicles 16:7-10 2 Chronicles 16:7-10  And at that time Hanani the seer came to Asa king of Judah, and said to him, Because you have relied on the king of Syria, and not relied on the LORD your God, therefore is the host of the king of Syria escaped out of your hand.  Were not the Ethiopians and the Lubims a huge host, with very many chariots and horsemen? yet, because you did rely on the LORD, he delivered them into your hand.  For the eyes of the LORD run to and fro throughout the whole earth, to show himself strong in the behalf of them whose heart is perfect toward him. Herein you have done foolishly: therefore from now on you shall have wars.  Then Asa was wroth with the seer, and put him in a prison house; for he was in a rage with him because of this thing. And Asa oppressed some of the people the same time.
American King James Version×). Now Jehu reprimands Jehoshaphat for forming an alliance with, and helping, Ahab. Unlike his father, Jehoshaphat apparently maintains a good attitude and continues to seek God, although he renews his alliance in treaties with Ahab's sons (2 Chronicles 20:35 2 Chronicles 20:35And after this did Jehoshaphat king of Judah join himself with Ahaziah king of Israel, who did very wickedly:
American King James Version×; 2 Kings 3:7 2 Kings 3:7And he went and sent to Jehoshaphat the king of Judah, saying, The king of Moab has rebelled against me: will you go with me against Moab to battle? And he said, I will go up: I am as you are, my people as your people, and my horses as your horses.
American King James Version×).