In a large saucepan, saute onion in butter until tender. Stir in the flour, parsley, salt, pepper, and thyme until blended. Gradually add milk. Bring to a boil; cook and stir for 2 minutes or until thickened. Stir in the soup. Remove from the heat; stir in the sour cream until blended.
In a large bowl, combine the potatoes and ham. In a greased 13x9x2 inch baking dish, layer half of the potato mixture, cheese and white sauce. Repeat layers. Cover and bake at 375* for 30 minutes. Uncover; bake 40-50 minutes longer or until potatoes are tender.