azure-devops-python-api icon indicating copy to clipboard operation
azure-devops-python-api copied to clipboard

Hi, for a project it would be great to be able to extract the start and end dates of all iterations. Is that possible with this Python API? Thanks for your help. Best regards.

Open UserDELB08 opened this issue 5 years ago • 1 comments

UserDELB08 avatar Aug 31 '21 09:08 UserDELB08

Yes, there is a function in the WorkClient class which allows to do that.

  1. Establish connection like described in the readme

  2. Get work_client work_client = connection.clients.get_work_client()

  3. Need to create an instance of the Team Context class. Necessary Information for that are the project- and team name or project id and team id team = TeamContext(project= "Test, project_id= None, team= "Test", team_id= None)

  4. Use function get_team_iterations iterations = work_client.get_team_iterations(team)

  5. Print all dates and names of iterations for result in iterations: print("Sprint Name: ", end = '') print(result.name) print("Start Date: ", end = '') print(result.attributes.start_date) print("Finish date: ", end = '') print(result.attributes.finish_date, "\n", "\n")

Hope it helps!

magnus-teschner avatar Sep 03 '21 13:09 magnus-teschner