It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) had cupping done while in the state of ihram due to a pain in his leg or a sprain in his back.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 14908
Hadith Gradingحکم دارالسلام:صحيح لغيره، أبو الزبير لم يصرح بسماعه من جابر، وانظر: 14280