Make filling: In a 5-quart saucepan bring 3 quarts water to a boil. Add chicken and simmer, uncovered, 20 minutes. Remove pan from heat and let stand 30 minutes. Transfer chicken to a bowl, discarding cooking liquid, and cool. Discard skin and bones. Cut chicken into 3/4-inch cubes and return to bowl.
In a 3-quart saucepan bring 2 quarts water to a boil and cook onions until tender, 7 to 8 minutes. Transfer onions with a slotted spoon to a bowl of ice and cold water, reserving cooking liquid in pan. Cut root ends off onions and peel. Add onions to chicken. Return reserved cooking liquid to a boil and cook carrots and celery until just tender, 4 to 5 minutes. Drain carrots and celery and add with peas to chicken mixture. In pan cook mushrooms in 1/2 tablespoon butter over moderate heat, stirring, until softened and golden brown and all liquid they give off is evaporated and add to chicken mixture.
In pan cook shallots with bay leaf, thyme, and tarragon in remaining 1 1/2 tablespoons butter over moderately low heat, stirring, until soft and pale golden and stir in flour. Cook mixture, stirring, 3 minutes (it will look crumbly) and gradually whisk in wine, broth, nutmeg, and salt and pepper to taste. Simmer sauce 5 minutes, whisking occasionally, and whisk in Sherry. Discard bay leaf. Pour sauce over chicken mixture and stir until combined well. Filling may be made 1 day ahead, cooled, uncovered, and chilled, covered.
Preheat oven to 425 F.
Make mashed potatoes:
Peel potatoes and cut into 1-inch pieces. In a saucepan cover potatoes with water by 1-inch simmer until very tender, 10 to 15 minutes. Reserve about 1/3 cup cooking liquid and drain potatoes. In batches, force potatoes through a ricer or food mill fitted with medium disk into a bowl and stir in sour cream, chives, salt and pepper to taste, and enough reserved cooking liquid to reach a fluffy consistency. Transfer potatoes to a pastry bag fitted with a 1/2-inch fluted tip.
Spread filling in a 1 1/2- to 2-quart gratin dish or other shallow baking dish. Pipe mashed potatoes decoratively in mounds on filling and bake in middle of oven until filling is bubbling and potatoes are golden on edges, about 25 minutes.
Recipe courtesy of Gourmet Magazine