How to autocomplete a Quest

I want to autocomplete quests that can not be completed normally while I find the way to fix them.

I have read about QuestType and Flags, but this does not work for me in some cases.
As example, the quest 12886. I tried everything and if I get to the point that I can make it autocompleted, I can not accept the mission from the quest giver and does not appear as completed in the quest log.
What do I need to do to autocomplete the quest, be available on the quest giver and show it completed for the player?