* They said that you had done your duty well. (This is the most common and direct way to change the sentence to indirect speech)
* They complimented you on doing your duty well. (This version emphasizes the positive nature of the statement)
* They told me that you had done your duty well. (This adds the speaker's perspective)
The best option depends on the context and what you want to emphasize.