The Prophet ﷺ was cupped on his head while in the state of ihram for an ailment he was suffering from, at a place called Lahy Jamal.In another narration, He was cupped on his head while in the state of ihram due to a migraine he was suffering from.
احتجم النبي ﷺ في رأسه وهو محرم من وجع كان به بماء يقال له: لحي جمل. وفي رواية: احتجم وهو محرم في رأسه من شقيقة كانت به.
Bukhari narrated it in the Book of Medicine (5700), from Muhammad bin Bashshar, who said, our teacher Ibn Abu Adi narrated to us, from Hisham (he is Ibn Hassan), from Ikrima, from Ibn Abbas, and he mentioned it. Muslim narrated it in the Book of Hajj (1202:87) through the route of Tawus and Ataa, from Ibn Abbas. The wording given is Bukhari's, and Muslim's version is abridged.The other narration was cited by Bukhari as a suspended chain following the previous narration, from Muhammad bin Sawa, who said, Hisham informed us, from Ikrima, in the same manner.Ibn Hajar said, "This suspended chain was connected by Ismaili, who said, Muhammad bin Abdullah Azdi narrated to us, our teacher Muhammad bin Sawa narrated to us, and he mentioned it in the same way."His statement, "migraine," refers to a type of headache that occurs in the front of the head and extends to one of its sides.