Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:246

Have you not considered the assembly of the Children of Israel after ˹the time of˺ Moses when they said to a prophet of theirs, "Send to us a king, and we will fight in the way of Allah "? He said, "Would you perhaps refrain from fighting if fighting was prescribed for you?" They said, "And why should we not fight in the cause of Allah when we have been driven out from our homes and from our children?" But when fighting was prescribed for them, they turned away, except for a few of them. And Allah is Knowing of the wrongdoers.  

Have you not seen, the story and the tale of, the council, an assembly, of the Children of Israel, after, the death of, Moses, when they said to a prophet of theirs, namely, Samuel, ‘Send, establish, for us a king, to unite us and to whom we can refer ˹matters˺, and we will fight, with him, in God’s way’. He, the prophet, said, to them: ‘Might it be that (‘asaytum, or ‘asītum) if fighting is prescribed for you, you will not fight? (allā tuqātilū is the predicate of ‘asā, ‘might it be’; the interrogative is intended to confirm the expectation that follows ˹sc. that they will not fight˺). They said, ‘Why should we not fight in God’s way, when we have been expelled from our habitations and our children?’, as a result of these latter being taken captive or killed, that which they suffered at the hands of Goliath and his men. The meaning is, ‘There is nothing to stop us fighting, provided the requirement ˹we demanded˺ is forthcoming’. God, exalted be He, says, Yet when fighting was prescribed for them, they turned their backs, from fighting in cowardice, except a few of them, the ones that crossed the river with Saul (Tālūt), as will be mentioned; and God has knowledge of the evildoers, and will requite them accordingly. The prophet then asked his Lord to send forth a king, and God responded by sending forth Saul.
القرآن:٢:٢٤٦

أَلَمْ تَرَ إِلَى الْمَلَإِ مِنْ بَنِي إِسْرَائِيلَ مِنْ بَعْدِ مُوسَىٰ إِذْ قَالُوا لِنَبِيٍّ لَهُمُ ابْعَثْ لَنَا مَلِكًا نُقَاتِلْ فِي سَبِيلِ اللَّهِ ۖ قَالَ هَلْ عَسَيْتُمْ إِنْ كُتِبَ عَلَيْكُمُ الْقِتَالُ أَلَّا تُقَاتِلُوا ۖ قَالُوا وَمَا لَنَا أَلَّا نُقَاتِلَ فِي سَبِيلِ اللَّهِ وَقَدْ أُخْرِجْنَا مِنْ دِيَارِنَا وَأَبْنَائِنَا ۖ فَلَمَّا كُتِبَ عَلَيْهِمُ الْقِتَالُ تَوَلَّوْا إِلَّا قَلِيلًا مِنْهُمْ ۗ وَاللَّهُ عَلِيمٌ بِالظَّالِمِينَ  

{ألم تر إلى الملأ} الجماعة {من بني إسرائيل من بعد} موت {موسى} أي إلى قصتهم وخبرهم {إذ قالوا لنبي لهم} هو شمويل {ابعث} أقم {لنا ملكا نقاتل} معه {في سبيل الله} تنتظم به كلمتنا ونرجع إليه {قال} النبي لهم {هل عسَيتم} بالفتح والكسر {إن كتب عليكم القتال أ} ن {لا تقاتلوا} خبر عسى والاستفهام لتقرير التوقع بها {قالوا وما لنا أ} ن {لا نقاتل في سبيل الله وقد أُخرجنا من ديارنا وأبنائنا} بسبيهم وقتلهم وقد فعل بهم ذلك قوم جالوت أي لا مانع لنا منه مع وجود مقتضيه قال تعالى: {فلما كُتب عليهم القتال تولوا} عنه وجبنوا {إلا قليلا منهم} وهم الذين عبروا النهر مع طالوت كما سيأتي {والله عليم بالظالمين} فمجازيهم وسأل النبي إرسال ملك فأجابه إلى إرسال طالوت.