Marwan said to his gatekeeper, "Go to Ibn ʿAbbas, O Rafiʿ, and say, 'If everybody who rejoices in what he has done, and likes to be praised for what he has not done, will be punished, then all of us will be punished." Ibn ʿAbbas said, "What connection have you with this case? It was only that the Prophet ﷺ called the Jews and asked them about something, and they hid the truth and told him something else, and showed him that they deserved praise for the favor of telling him the answer to his question, and they became happy with what they had concealed. Then Ibn ʿAbbas recited:-- "(And remember) when Allah took a Covenant from those who were given the Scripture..and those who rejoice in what they have done and love to be praised for what they have not done.' " (3.187-188) Humaid bin ʿAbdur-Rahman bin ʿAuf narrated that Marwan had told him (the above narration).
أَنْ يُحْمَدَ بِمَا لَمْ يَفْعَلْ مُعَذَّبًا لَنُعَذَّبَنَّ أَجْمَعُونَ فَقَالَ ابْنُ عَبَّاسٍ وَمَا لَكُمْ وَلِهَذِهِ إِنَّمَا دَعَا النَّبِيُّ ﷺ يَهُودَ فَسَأَلَهُمْ عَنْ شَىْءٍ فَكَتَمُوهُ إِيَّاهُ وَأَخْبَرُوهُ بِغَيْرِهِ فَأَرَوْهُ أَنْ قَدِ اسْتَحْمَدُوا إِلَيْهِ بِمَا أَخْبَرُوهُ عَنْهُ فِيمَا سَأَلَهُمْ وَفَرِحُوا بِمَا أُوتُوا مِنْ كِتْمَانِهِمْ ثُمَّ قَرَأَ ابْنُ عَبَّاسٍ {وَإِذْ أَخَذَ اللَّهُ مِيثَاقَ الَّذِينَ أُوتُوا الْكِتَابَ} كَذَلِكَ حَتَّى قَوْلِهِ {يَفْرَحُونَ بِمَا أَتَوْا وَيُحِبُّونَ أَنْ يُحْمَدُوا بِمَا لَمْ يَفْعَلُوا}