The solution is to push back on whoever assigned the task to you and what the value of it is, what the end result should look like, etc. If it's worthless effort and busy work, make them understand it. If it's just the boring drudge that makes the better things happen, at least you can be engaged in the end goal.
Discipline is the first answer that comes to mind... but say it out loud and... yeah, it's a non-answer.