Is it possible to request a custom workitem field in the TFS SDK

I have several work items that contain a custom field called "Reference ID" whether it is possible to request the use of wiql in this custom field. I am currently using the following approach:

// foreach project in TFS

// form wiql

WorkItemCollection workItemCollection = workItemStore.Query(
                    " SELECT [System.Id], [System.WorkItemType]," +
                    " [System.State], [System.AssignedTo], [System.Title] " +
                    " FROM WorkItems " +
                    " WHERE [System.TeamProject] = '" + tfsProject.Name +
                    "' ORDER BY [System.WorkItemType], [System.Id]");

// run the loop with the result set

// if workitem.Fields ["Reference ID"] = required value

// perform some tasks on this work item

this approach takes quite often, since there are more than 1000 results.

my question is: is it possible to add a special field also as a filter condition in the above query

+3
source share
3 answers

. , . Process Explorer (TFS Power Tools) WorkItemType.

,

Select Id from WorkItems where ([xxx.Ticket.OriginalTicketID] = '12345');
+2

, .

0

If you do not have access to TFS Power Tools or the ability to install it, you can also use the DisplayForm property of the Work Item object.

myItem = Workitem.GetWorkItem("12345")
myItem.DisplayForm

DisplayForm returns an XML containing all Field Names and Properties. You can look at the XML by label and get the corresponding ControlName field.

myItem.Fields.Item("Custom.FieldName")
0
source

Source: https://habr.com/ru/post/1755279/


All Articles