locked
Unable retrieve custom workitem field from WorkItemChangedEvent RRS feed

  • Question

  • Hi all,

    I'm implementing tfs server plugin and I'm trying to retrieve workitem fields from WorkItemChangedEvent. It is working fine with system work item field; however, got an exception from custom work item field. Am I missing something? Please advise

    string areaPathField = WorkItemChangedEvent.CoreFields.StringFields.FirstOrDefault(t => t.ReferenceName == "System.AreaPath").NewValue; // working
    string appname = WorkItemChangedEvent.CoreFields.StringFields.FirstOrDefault(t => t.ReferenceName == "Custom.Field.ProjectName").NewValue; // not working and got an exception below

    Detailed Message: TFS plugin WorkItemChangedNotificationPlugin encountered an exception
    Exception Message: Object reference not set to an instance of an object. (type NullReferenceException)
    Exception Stack Trace:    at WageWorks.TFSPlugin.WIEventChanges.ReleaseWorkItemChanged(WorkItemChangedEvent ev) in C:\TFS2013WS\BuildsRelease\vNextPlatform\WageWorks.TFSPlugin\WageWorks.TFSPlugin\WIEventChanges.cs:line 96
       at WageWorks.TFSPlugin.WIEventChanges.ProcessEvent(IVssRequestContext requestContext, NotificationType notificationType, Object notificationEventArgs, Int32& statusCode, String& statusMessage, ExceptionPropertyCollection& properties) in C:\TFS2013WS\BuildsRelease\vNextPlatform\WageWorks.TFSPlugin\WageWorks.TFSPlugin\WIEventChanges.cs:line 63

    Best Regards,

    Andy Pham


    Best Regards, Andy Pham


    • Edited by AndyPham Monday, October 30, 2017 11:03 PM
    Friday, October 27, 2017 10:36 PM