Last active
January 15, 2016 14:39
-
-
Save tomkuijsten/c090269308cc86968206 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rule name="AutoOpen" appliesTo="Task"> | |
<!-- Update Work Item to Committed if a task became "active" --> | |
<![CDATA[ | |
if (new[] {"In Progress", "To Do"}.Contains((string)self["System.State"])) | |
{ | |
if(self.HasParent() && (string)self.Parent["System.State"] != "Committed") | |
{ | |
self.Parent.TransitionToState("Committed", "Auto Activated"); | |
} | |
} | |
]]> | |
</rule> | |
<rule name="AutoClose" appliesTo="Task"> | |
<!-- Update Work Item to Done if a all child tasks are Done or Removed --> | |
<![CDATA[ | |
if ((string)self["System.State"] == "Done" && self.HasParent() && ((string)self.Parent["System.State"]) != "Done") | |
{ | |
if (self.Parent.Children.All(child => new[] {"Removed", "Done"}.Contains((string)child["System.State"]))) | |
{ | |
self.Parent.TransitionToState("Done", "Auto done"); | |
} | |
} | |
]]> | |
</rule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment