-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent event trigger from within rule causing the event #276
Comments
Only when introducing a custom field where you add so your rule can use it
to make a judgment call. (possibly the history field, though this may cause
pollution of the discussion field.)
Or possibly using a time based mechanism to prevent updates based on a
certain field within x secs.
Or by checking the user who made the last change (in case you're not using
impersonation).
There is no built in mechanism in the plugin itself, since we lack the
information to base such a decision on...
…On 20 Feb 2018 23:45, "John D. Shkolnik" ***@***.***> wrote:
Hi,
Below code is based on scrum template where epic can have one or more
feature children. If a feature is updated, it will aggregate effort for all
of its parent epic's children which, in turn, will trigger the epic's rule
to aggregate effort of all its children. Is there any way to
bypass/suppress the second trigger? The parent's rule is necessary as a
workaround to being unable to respond to deleted children (#275
<#275>) but I
imagine it'd be handy in other cases as well.
<rule name="RollupEpics" changes="New,Change,Restore" appliesTo="Epic"><![CDATA[
if (self.HasChildren())
{
self["Microsoft.VSTS.Scheduling.Effort"] = self.Children.Where(req => req["System.State"].ToString() != "Removed").Sum(req => req.GetField<double>("Microsoft.VSTS.Scheduling.Effort", 0d));
}
]]></rule>
<rule name="RollupFeatures" changes="New,Change,Restore" appliesTo="Feature"><![CDATA[
if (self.HasParent())
{
var parent = self.Parent;
if (parent.TypeName == "Epic")
{
parent["Microsoft.VSTS.Scheduling.Effort"] = parent.Children.Where(req => req["System.State"].ToString() != "Removed").Sum(req => req.GetField<double>("Microsoft.VSTS.Scheduling.Effort", 0d));
}
}
if (self.HasChildren())
{
self["Microsoft.VSTS.Scheduling.Effort"] = self.Children.Where(req => req["System.State"].ToString() != "Removed").Sum(req => req.GetField<double>("Microsoft.VSTS.Scheduling.Effort", 0d));
}
]]></rule>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#276>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AD-uS-GTTOP_z6OfGc5MMtoY9gslKILKks5tW0rzgaJpZM4SMyuz>
.
|
Worst case you will recalculate the value, try to store it, we will detect that no real changes occurred and we'll skip the save. This will not cause you to end endless loops. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Below code is based on scrum template where epic can have one or more feature children. If a feature is updated, it will aggregate effort for all of its parent epic's children which, in turn, will trigger the epic's rule to aggregate effort of all its children. Is there any way to bypass/suppress the second trigger? The parent's rule is necessary as a workaround to being unable to respond to deleted children (#275) but I imagine it'd be handy in other cases as well.
The text was updated successfully, but these errors were encountered: