File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 11# Sample Aggregator CLI usage
22
3- Remember that the Instance name must be unique in Azure.
3+ Remember that the Instance name must be unique in Azure (CLI automatical append ` aggregator ` suffix to help) .
44
55```
66# logon
Original file line number Diff line number Diff line change @@ -45,9 +45,22 @@ return self.PreviousRevision.PreviousRevision.Description;
4545# Create new Work Item
4646```
4747var parent = self;
48- var newChild = store.NewWorkItem("Task");
49- newChild.Title = "Brand new child";
50- parent.Relations.AddChild(newChild);
48+
49+ // test to avoid infinite loop
50+ if (parent.WorkItemType == "Task") {
51+ return "No root type";
52+ }
53+
54+ var children = parent.Children;
55+ // test to avoid infinite loop
56+ if (!children.Any(c => c.Title == "Brand new child"))
57+ {
58+ var newChild = store.NewWorkItem("Task");
59+ newChild.Title = "Brand new child";
60+ parent.Relations.AddChild(newChild);
61+
62+ return "Item added";
63+ }
5164
5265return parent.Title;
5366```
You can’t perform that action at this time.
0 commit comments