An attack was on the way from polytheist’s side, they were planning to attack the outskirts of Madinah. With the news reaching the Prophet (p) he despatched his Companions to engage the enemy.
Kitab al-tabaqat al-kabir – Ibn Sa’d:
“THE SARIYYAH OF BASHIR IBN SA’D AL-ANSARI TOWARDS YAMAN AND JAMAR
Then (occurred) the sariyyah of Bashir Ibn Sa’d al-Ansari towards Yaman and Jamar in Shawwal of the seventh year from the hijrah of the Apostle of Allah. They (narrators) said: It (report) reached the Apostle of Allah, that Uyaynah Ibn Hisn has promised a party of the Ghatafan at al-Jinab to lead them to encounter the Apostle of Allah. …” 
“In Shawwal 7 A.H., Basheer bin Sa’d Al-Ansari marched towards Yemen and Jabar at the head of 300 Muslim fighters to subdue a large mob of polytheists who gathered to raid the outskirts of Madinah. Basheer and his men used to march at night and lurk during the day until they reached their destination. Having heard about the advent of the Muslims, the polytheists fled away leaving behind them a large booty and two men who later embraced Islam on arrival in Madinah.” 
Don’t forget to follow Discover The Truth on Facebook and Twitter. PLEASE help spread the word by sharing our articles on your favourite social networks. Thank You!
 Kitab al-tabaqat al-kabir, by Ibn Sa’d, volume 2, page 149
 Sealed Nectar (‘Ar-Raheeq Al-Makhtum’), By Safiur-Rahman Al-Mubarakpuri, page 241