I have tried to use the script-
PARENT.PARENT STRING_PROPERTY("Name")+" " + PARENT STRING_PROPERTY("Name")+" "+ STRING_PROPERTY("Name")
I had created a user field of my own which got the WBS path there & I recalculated user field values and then I copy these values over to the corresponding resources of the tasks.