Bhishma tells Yudhishthira the tale to show compassion. A fowler of Kashi poisons a forest tree by a stray arrow. The parrot born in it refuses to go and wastes away with it. Indra comes as a Brahmin, is recognised, and argues that the dead tree is useless when the forest is full of others. The parrot replies that the tree sheltered and formed him and that kindness to a benefactor is the test of virtue. Indra grants a boon; the parrot asks only that the tree live. Indra sprinkles nectar, the tree revives, and the parrot later attains Indra's world.
North India · Himalaya, bank of the GangesBuddhist
A parrot king lives contented in a fig tree by the Ganges in the Himalaya, eating shoots and bark when the fruit is gone. His contentment shakes Sakka's seat. Sakka withers the tree to a dusty stump to test him; the parrot eats the dust and stays. Sakka comes as a royal goose with Suja and urges him to leave; the parrot says he will not abandon an old friend. Offered a boon, he asks that the tree live; Sakka dashes Ganges water on the stump and it rises full of sweet fruit. The parrot was the Bodhisatta, and the story is told to a monk unhappy with poor alms.
What is different here:
Sakka causes the withering himself as a test; goose disguise, not Brahmin; river water, not nectar; a fig tree and a parrot king; framed as a lesson in contentment for a monk.
Sources: The Mahabharata, tr. K. M. Ganguli (1883-96), sections read for the Vedic layer; The Jataka, vol. III, tr. H. T. Francis and R. A. Neil (1897): no. 429 Mahasuka-Jataka; no. 316 Sasa-Jataka