0
votes

I am using .NET client libraries such as Microsoft.TeamFoundationServer.Client to retrieve the work items in Azure DevOps.

However, I could not find how to get the picklist information through the .NET client libraries though it is mentioned in the Azure DevOps Services REST API documentation (See below image)

Get picklist information using the Azure DevOps Services REST API

Is there a way to retrieve the picklist information through the .NET client libraries (such as via Microsoft.TeamFoundationServer.Client)?

1
Is the following api helpful for you?Cece Dong - MSFT
For the moment I've used the REST API. Should use this Client Library sample code you have posted here and check whether it does what I need. Thanks for the answer.Senura Dissanayake
If it helps you, you could Accept it as an Answer, this can be beneficial to other community members reading this thread.Cece Dong - MSFT

1 Answers

1
votes

Check the sample here: https://github.com/microsoft/azure-devops-dotnet-samples/blob/main/ClientLibrary/Samples/WorkItemTrackingProcess/ProcessesSample.cs

            string _personalAccessToken = "xxxxxx";
            VssBasicCredential credentials = new VssBasicCredential("", _personalAccessToken);
            var connection = new VssConnection(new Uri(@"https://dev.azure.com/xxx"), credentials);

            WorkItemTrackingProcessHttpClient client = connection.GetClient<WorkItemTrackingProcessHttpClient>();

            Console.Write("Getting list of processes....");

            List<ProcessInfo> list = client.GetListOfProcessesAsync().Result;

            if (list == null || list.Count == 0)
            {
                Console.WriteLine("No processes found");
            }
            else
            {
                Console.WriteLine("Done");

                foreach (var item in list)
                {
                    Console.WriteLine("{0}    {1}    {2}", item.Name, item.TypeId, item.ReferenceName);
                }
            }