I need to get all the parent hierarchy from a work item.
The parent of the parent of the parent.. find all the parent links.
There is a way to do it via API?
Thanks 🙂
I need to get all the parent hierarchy from a work item.
The parent of the parent of the parent.. find all the parent links.
There is a way to do it via API?
Thanks 🙂
2
Answers
Yes, you can.
But you must use code to handle this situation. The below is a Python demo.
I can successfully get all parents of workitem id ‘120’:
The above is the API of Python SDK Demo, if you want to use REST API, I can also give you an idea.
Just call this REST API:
You can call it again after getting the current parent:
Official document of the REST API:
Work Items – Get Work Item
Try the following PowerShell script: (In this sample, the work item
2434
is the last parent work item – top1 parent,2435
is top2 parent …)