The Jataka, Vol. II, tr. by W.H.D. Rouse, , at sacred-texts.com
"Who is it sits," etc.--This story the Master told at the Bamboo-grove, about Devadatta and Kokālika. At the time when Devadatta began to lose his gettings and his repute, Kokālika went from house to house, saying, "Elder Devadatta is born of the line of the First Great King, of the royal stock of Okkāka 2, by an uninterrupted noble descent, versed in all the scriptures, full of ecstatic sanctity, sweet of speech, a preacher of the law. Give to the Elder, help him!" In these words he praised up Devadatta. On the other hand, Devadatta praised up Kokālika, in such words as these: "Kokālika comes from a northern brahmin family; he follows the religious life; he is learned in doctrine, a preacher of the law. Give to Kokālika, help him!" So they went about, praising each other, and getting fed in different houses. One day the brothers began to talk about it in the Hall of Truth. "Friend, Devadatta and Kokālika go about praising each other for virtues which they haven't got, and so getting food." The Master came in, and asked what they were talking about as they sat there. They told him. Said he, "Brethren, this is not the first time that these men have got food by praising each other. Long ago they did the same," and he told them an old-world tale.
Once upon a time, when Brahmadatta was king of Benares, the Bodhisatta became a tree-sprite in a certain rose-apple grove.  9 Crow perched upon a branch of his tree, and began to eat the fruit. Then came a Jackal, and looked up and spied the Crow. Thought he, "If I flatter this creature, perhaps I shall get some of the fruit to eat!" So in flattery he repeated the first stanza:
The Crow, in his praise, responded with the second:
With these words she shook the branch and made some fruit drop.
[paragraph continues] Then the spirit of the tree, beholding these two eating, after flattering each other, repeated the third stanza:
After repeating this stanza, the tree-sprite, assuming a fearful shape, scared them both away.
When the Master had ended this discourse, he summed up the Birth-tale; "At that time the Jackal was Devadatta, the Crow was Kokālika, but the Spirit of the Tree was I myself."
299:1 Compare No. 295, and Æsop's fable of the Fox and the Crow.
299:2 A fabulous king, the same as Ikshvāku. See reff. in J. P. T. S. 1888, p. 17.