Translated it's "누가 제 이름이 뭐냐고 물어봤어요."
Literally meaning, "Someone asked me what my name was."
If you want a closer translation to your sentence, then it's "누가 저한테 물어봤어요, '이름이 뭐예요?'"
But the first one sounds more natural if you're talking to someone.
Hope that helps!