Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4012932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:18:31+00:00 2026-05-20T09:18:31+00:00

We have a custom build process (not using MS Build) and during that process

  • 0

We have a custom build process (not using MS Build) and during that process I am adding a “fake” build to the global builds list. The reason I am doing that is so that you can select the build for a given work item (found in build). We have a custom field, build included, which is intended to show which build that work item was fixed in. I am having trouble figuring out how to update this field programmatically. The idea is I will have a small app that does this that I will call during the build process, finding all work items since the last build, then updating the field for those work items. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:18:31+00:00Added an answer on May 20, 2026 at 9:18 am

    Something like this should work for you:

    public void UpdateTFSValue(string tfsServerUrl, string fieldToUpdate, 
       string valueToUpdateTo, int workItemID)
    {   
        // Connect to the TFS Server
        TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(tfsUri));
        // Connect to the store of work items.
        _store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
        // Grab the work item we want to update
        WorkItem workItem = _store.GetWorkItem(workItemId);
        // Open it up for editing.  (Sometimes PartialOpen() works too and takes less time.)
        workItem.Open();
        // Update the field.
        workItem.Fields[fieldToUpdate] = valueToUpdateTo;
        // Save your changes.  If there is a constraint on the field and your value does not 
        // meet it then this save will fail. (Throw an exception.)  I leave that to you to
        // deal with as you see fit.
        workItem.Save();    
    }
    

    An example of calling this would be:

    UpdateTFSValue("http://tfs2010dev:8080/tfs", "Integration Build", "Build Name", 1234);
    

    The variable fieldToUpdate should be the name of the field, not the refname (ie. Integration Build, not Microsoft.VSTS.Build.IntegrationBuild)

    You could probably get away with using PartialOpen(), but I am not sure.

    You will probably need to add Microsoft.TeamFoundation.Client to your project. (And maybe Microsoft.TeamFoundation.Common)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a custom navigation webpart that uses the PortalSiteMapProvider of MOSS to build
I have a build process that does the following: Runs TLBIMP on a number
I have a solution with several projects in it that executes many custom build
I have a custom build of gcc/gdb that I'm trying to integrate with an
I have a project in IAR Workbench that requires a custom build step to
I have three custom build configurations { Dev, Qs, Prd }. So, I have
I have inherited a visual studio 2003 project which uses some custom build steps.
I'm going to have to build a custom control for a WinForms application. But
We have a custom-built Flash-based video player that I maintain, and it needs to
I have a custom application that was built to send opt-in newsletters and marketing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.