Please help convert this to the new tfsaggregator policies

Jan 5, 2016 at 5:35 AM
Hi,

I have the following old aggregator rule would like to convert it to the new policies format since we are upgrading our TFS to 2015 Update1
<!--Add the time from the task up to the parent--> <AggregatorItem operation="Sum" linkType="Parent" linkLevel="1" workItemType="Ticket">
<TargetItem name="Requirement Total Estimate"/>
 <SourceItem name="Developer Estimate"/>
</AggregatorItem>
Jan 5, 2016 at 10:50 PM
Hi,

I just figured out myself hope this samples might help out other if they convert to the policy ruleset.

<?xml version="1.0" encoding="utf-8"?>
<AggregatorConfiguration>
<runtime>
    <logging level="Diagnostic"/>
  <authentication autoImpersonate="false" />
</runtime>

<!-- Add the time from the task up to the parent -->
<rule name="Rollup" appliesTo="Ticket">
    <![CDATA[


  if (self.HasParent())
  {
  var parent = self.Parent;
  parent["Requirement Total Estimate"] = parent.Children.Sum(ticket => ticket.GetField<double>("Developer Estimate", 0d));
  }
    ]]>
</rule>

<policy name="DefaultPolicy">
    <collectionScope collections="*" />
    <ruleRef name="Rollup" />
</policy>
</AggregatorConfiguration>