The OED has this to say about Forlorn Hope:
forlorn hope 1 A persistent or desperate hope that is unlikely to be
fulfilled: he urged them to stay in the forlorn hope of restoring
peace [ mid 16th century: from Dutch verloren hoop 'lost troop', from
verloren (past participle of verliezen 'lose') and hoop 'company'. The
phrase originally denoted a band of soldiers picked to begin an
attack, many of whom would not survive; the current sense (mid 17th
century), derives from a misunderstanding of the etymology]
So that may or may not be appropriate. The military "forlorn hope" was adopted by the British Army during the Napoleonic Wars, and referred to similar companies as described above - picked to commence a wall breach or to stack ladders during a siege, or alternatively to flush out the enemy from positions of cover.
"Pyrrhic" also came to mind - but that sort of assumes that at least one thing will have succeeded at the end.
There is also "Nugatory" and "Bootless" - both feature the futility of the task, but neither describe the mandatory nature of the task as requested. I think the only way of encapsulating both concepts is with "Dilbertian", otherwise you're stuck qualifying one word with another, e.g. "Mandatory yet Bootless".