How to generate linked workitem's custom attributes in RPE?

Hi,
I have a work item Task A, it has a related work item Task B (Linked to Task A with related link type).
I'm trying to generate all the related workitems of Task A by giving query workitem/workitem/related.
I'm able to generate the related work items.
I want to generate related work item's (Task B's) custom attributes details.
I'm giving a query workitem/workitem/allextentions (displayname=="name" and displayvalue for the value of the custom attribute)
But I'm not able to generate the custom attributes of Task B.
Please provide me the solution.
Regards,
Lochana