Home > Enterprise >  azure devops python get all links (child / parent) for work item
azure devops python get all links (child / parent) for work item

Time:09-28

i have a work item created in azure devops

from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
from azure.devops.v6_0.py_pi_api import JsonPatchOperation
import pprint

# Fill in with your personal access token and org URL
personal_access_token = '<pat>'
organization_url = 'https://dev.azure.com/<org>'

# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)

# Get a client (the "core" client provides access to projects, teams, etc)
wi_client = connection.clients.get_work_item_tracking_client()

ads_id= 2129

parent_work_item = wi_client.get_work_item(ads_id);

# how to get child/parent work items?

if i run the get_work_item function, it returns data, but has 'relations': None as if there is no parent/child links, even though i can see those links online. is there someway I can get the parent/child links with a function call?

CodePudding user response:

I know the reason for your issue, enter image description here

enter image description here

  • Related