saumya  srivastava
saumya srivastava

Reputation: 23

query regarding TFS workitem

I want to know how I can update the field of my bug workitem. Suppose I need to change title of my bug workitem and after doing that I should get one pop up message box that my title field has changed without using email alerts? This is the query to select the workitem of a particular team project:

var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection
       (new Uri("server url"));

var service = tfs.GetService<WorkItemStore>();

var qText = String.Format(@"SELECT [System.WorkItemType], 
          [System.Title], [System.Description], [System.Reason] 
              FROM WorkItems WHERE [System.TeamProject] = {0}", "'Demo1'");

I want to know the update query for changing the particular field.

Upvotes: 1

Views: 208

Answers (2)

xcodr
xcodr

Reputation: 1177

Have you tried something like:

Dim workItemStore as WorkItemStore = tfs.GetService(Of WorkItemStore)()
Dim wi as WorkItem = workItemStore.GetWorkItem(workItemNumber)
wi.Fields("System.Title").Value = "Foo Title"
wi.Save()

Upvotes: 2

Mike Cheel
Mike Cheel

Reputation: 13116

I don't think WIQL supports dml commands. You are probably going to have to use the object model to do this: http://msdn.microsoft.com/en-us/library/bb130323.aspx

Upvotes: 0

Related Questions