Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

TFS 2012 Append Issue Description Doesn't Work



  • I'm using the TFS 2012 extension, and the "Append Issue Description" action doesn't seem to work with any TFS work item type (user stories, bugs, etc.) of any status (New, Active, Resolved, Closed, etc.). We are using TFS 2013 on-premise. When I try to append some text to an issue during the deployment, I get this:

      Source Directory: C:\BuildMaster\_SVCTMP\_A10\_S12\SRC
      Target Directory: C:\BuildMaster\_SVCTMP\_A10\_S12\WRK
      Server: CO01GRGDEV01X (Id: 1)
    Initializing action...
    Initialization complete. Executing...
    Appending 'Fake-Deployed to Development' to Issue #975
    An unhandled exception occurred while executing this action: Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF400276: You have tried to set a value for a field of a work item which is not opened or partial opened. You cannot set a value for a field of a work item which is not opened or partial opened.
       at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.SetFieldValue(Int32 id, Object value, FieldFlags flags)
       at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.SetFieldValueExternal(FieldDefinition fd, Object value)
       at Inedo.BuildMasterExtensions.TFS2012.Tfs2012IssueTrackingProvider.AppendIssueDescription(String issueId, String textToAppend)
       at Inedo.BuildMaster.Extensibility.Actions.IssueTracking.AppendIssueDescriptionAction.Execute()
       at Inedo.BuildMaster.Extensibility.Actions.ActionBase.ExecuteInternal(IActionExecutionContext context, ExtensionConfigurerBase extensionConfigurer, Boolean resumeNextOnError, Boolean logErrorsAsWarnings)
    

    Product: BuildMaster
    Version: 4.1.6



  • I think the error message is confusing. The stuff about being "opened or partial opened" isn't about the work item status, but refers to the fact that the AppendIssueDescription() code needs to explicitly call workItem.PartialOpen() before changing any fields...

    public void AppendIssueDescription(string issueId, string textToAppend)
    {
        using (var tfs = this.GetTeamProjectCollection())
        {
            var workItem = GetWorkItemByID(tfs.GetService<WorkItemStore>(), issueId);
    
            workItem.PartialOpen(); // <-- new code
            workItem.Description += Environment.NewLine + textToAppend;
            workItem.Save();
            workItem.Close(); // <-- new code
        }
    }


  • Thanks for the additional information. I've logged this as an item in TFS (https://github.com/Inedo/bmx-tfs2012/issues/16), and we'll fix it ASAP.

    In the mean time, it might be easy to work-around with doing a clone/patch: http://inedo.com/support/tutorials/cloning-and-patching-an-inedo-extension.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation