Skip to content
This repository has been archived by the owner on Jan 6, 2019. It is now read-only.

Parent property isn't exposed for LastRevision access to WI #2

Closed
yan95g opened this issue Nov 2, 2017 · 1 comment
Closed

Parent property isn't exposed for LastRevision access to WI #2

yan95g opened this issue Nov 2, 2017 · 1 comment

Comments

@yan95g
Copy link

yan95g commented Nov 2, 2017

Steps to Reproduce:

  1. having link to last revision of workitem
    var Last = self.LastRevision
  2. try to get access to Parent in order to get linked WI
    var parent = Last.Parent

Rule example:

<rule name="TakeLastParent" appliesTo="Bug,Product Backlog Item">
    <![CDATA[
      if (!self.HasParent())
	   {var sum = 0.0;
		var parentFeature = self.LastRevision.Parent;
	    sum = parentFeature.Children.Where(c => ((string)c["System.WorkItemType"])=="Bug" || ((string)c["System.WorkItemType"])=="Product Backlog Item").Sum(c => c.GetField<double>("Microsoft.VSTS.Scheduling.Effort",0.0));
        parentFeature.Fields["Microsoft.VSTS.Scheduling.Effort"].Value = sum;
	   }
	]]>		
</rule>

Expected Result:
code is compiled and provide access to Parent WI if that exists including access to fields and values
Actual Result:
following error is thrown by console app:

[Error] 04.774 Error CS1061 in script 'TakeLastParent' at line 5, column 42: 'Aggregator.Core.Interfaces.IRevision' does not contain a definition for 'Parent' and no extension method 'Parent' accepting a first argument of type 'Aggregator.Core.Interfaces.IRevision' could be found (are you missing a using directive or an assembly reference?)

Environment:
TFS 2017 U2 On Premise - TFS Aggregator Server Plugin 2.3 RC1

@jessehouwing
Copy link
Contributor

OHh I remember... In the object model that link collection is of yet another type than the standard link collection, which is why I had decided not to add it when we added link support and revision support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants