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.
tabarani:6262ʿAbdān b. Aḥmad > ʿUthmān b. Abū Shaybah > Abū Aḥmad al-Zubayrī > Sufyān > Mūsá b. ʿUbaydah > Iyās b. Salamah b. al-Akwaʿ from his father

[Machine] We were with the Messenger of Allah ﷺ at a funeral and the people praised him with good praises. The Messenger of Allah ﷺ then said, "Wajabat (it is obligatory)." They asked, "O Messenger of Allah, what is obligatory?" He replied, "The angels are witnesses of Allah in the heavens and you are witnesses of Allah on the earth, so when you bear witness, it becomes obligatory (to speak the truth)."  

الطبراني:٦٢٦٢حَدَّثَنَا عَبْدَانُ بْنُ أَحْمَدَ ثنا عُثْمَانُ بْنُ أَبِي شَيْبَةَ ثنا أَبُو أَحْمَدَ الزُّبَيْرِيُّ ثنا سُفْيَانُ عَنْ مُوسَى بْنِ عُبَيْدَةَ عَنْ إِيَاسِ بْنِ سَلَمَةَ بْنِ الْأَكْوَعِ عَنْ أَبِيهِ قَالَ

كُنَّا مَعَ رَسُولِ اللهِ ﷺ فِي جِنَازَةٍ فَأَثْنَى الْقَوْمُ عَلَيْهِ ثَنَاءً حَسَنًا فَقَالَ رَسُولُ اللهِ ﷺ «وَجَبَتْ» فَقَالُوا يَا رَسُولَ اللهِ فَمَا وَجَبَتْ؟ قَالَ «الْمَلَائِكَةُ شُهَدَاءُ اللهِ فِي السَّمَاءِ وَأَنْتُمْ شُهَدَاءُ اللهِ فِي الْأَرْضِ فَإِذَا شَهِدْتُمْ وَجَبَتْ»  


See similar narrations below:

Collected by Nasāʾī
nasai:1933Muḥammad b. Bashhār > Hishām b. ʿAbd al-Malik > Shuʿbah > Ibrāhīm b. ʿĀmir And Jadduh Umayyah b. Khalaf > ʿĀmir b. Saʿd > Abū Hurayrah

"A funeral passed by the Prophet and they praised (the deceased). The Prophet said: 'It is granted.' Then another funeral passed by and they criticized (the deceased). The Prophet said: 'It is granted.' They said: 'O Messenger of Allah, you said in both cases, 'It is granted?' The Prophet said: 'The angels are the witnesses of Allah in heaven, and you are the witnesses of Allah on Earth."'  

النسائي:١٩٣٣أَخْبَرَنَا مُحَمَّدُ بْنُ بَشَّارٍ قَالَ حَدَّثَنَا هِشَامُ بْنُ عَبْدِ الْمَلِكِ قَالَ حَدَّثَنَا شُعْبَةُ قَالَ سَمِعْتُ إِبْرَاهِيمَ بْنَ عَامِرٍ وَجَدُّهُ أُمَيَّةُ بْنُ خَلَفٍ قَالَ سَمِعْتُ عَامِرَ بْنَ سَعْدٍ عَنْ أَبِي هُرَيْرَةَ قَالَ

مَرُّوا بِجَنَازَةٍ عَلَى النَّبِيِّ ﷺ فَأَثْنَوْا عَلَيْهَا خَيْرًا فَقَالَ النَّبِيُّ ﷺ وَجَبَتْ ثُمَّ مَرُّوا بِجَنَازَةٍ أُخْرَى فَأَثْنَوْا عَلَيْهَا شَرًّا فَقَالَ النَّبِيُّ ﷺ وَجَبَتْ قَالُوا يَا رَسُولَ اللَّهِ قَوْلُكَ الأُولَى وَالأُخْرَى وَجَبَتْ فَقَالَ النَّبِيُّ ﷺ الْمَلاَئِكَةُ شُهَدَاءُ اللَّهِ فِي السَّمَاءِ وَأَنْتُمْ شُهَدَاءُ اللَّهِ فِي الأَرْضِ