It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that he said: "Cupping (hijamah) for the fasting person was first disliked when Sayyiduna Ja'far bin Abi Talib (may Allah be pleased with him) had himself cupped while fasting, and the Messenger of Allah (peace and blessings be upon him) passed by him and said: 'These two have broken their fast.' Then after that the Prophet (peace and blessings be upon him) granted a concession for the fasting person to have cupping done."
And Sayyiduna Anas (may Allah be pleased with him) used to have himself cupped while fasting.
Imam al-Daraqutni (may Allah have mercy on him) said: "All of these narrators are thiqat (trustworthy), and I do not know of any hidden defect ('illah) in this hadith."
Related hadith on this topic