Heat a tablespoon of olive oil in a large saucepan over a medium-high heat, season the chicken thighs and colour them on both sides, half at a time. Just before the end of cooking the second batch, drain off all but a tablespoon of the fat, then stir in the garlic and cook for a moment.
Return all the chicken to the pan, sprinkle over the flour and turn the chicken to coat it. Add the wine which will thicken as it blends with the flour and let this simmer for a moment.
Pour in the chicken stock or water and stir. Add the thyme, lemon zest and some seasoning. Bring the sauce to a simmer, cover and cook over a low heat for 30 minutes, stirring once.
Remove the chicken pieces and place in a bowl. Take off and discard the skin and coarsely shred the flesh. Skim any fat off the surface of the sauce and strain it into a non-stick pan. Simmer to reduce by about half, then stir in the crème fraîche and capers, and adjust the seasoning. Stir in the chicken and transfer this to an ovenproof dish.
Boil the potatoes until tender, then drain them. Now mash them very coarsely, partly chopping them with the side of the masher. Stir in 3 tablespoons of olive oil and some salt, and then the parsley. Spoon the potato on top of the chicken. The pie can be prepared in advance, in which case leave it to cool, then cover and chill.
Heat the oven to 400F, and bake for 35-40 minutes until golden and the potato is crisp.