Closed mmuresan closed 4 years ago
I will check this later.
just for completeness:
I don't get any errors. The new item gets created correctly with all the fields setup correctly, as per the attached rule. It is not added though as a child to the parent, as specified in the rule.
That's odd. I just set a rule up that adds both children and parent links on 0.9.10 release and it is working. Example of what is working is below.
message += "Task being created...";
var child = store.NewWorkItem("Task");
child.Title = task;
child.Tags = self.Tags;
child.IterationPath = self.IterationPath;
child.AreaPath = self.AreaPath;
self.Relations.AddChild(child);
I let your rule run, and it created a child task correctly below the affected item.
the only thing I changed during execution was string bug = "Feature";
but this should not matter.
Have you all tried this on Creating a new work item? On Updating a work item, it might work correctly, but not on Creating a new work item.
mmuresan -
Yes, I have tried this on creating a new work item. The code that I am using for a similar rule was mentioned above but it uses a newly created work item in the relations process. I'm repasting it here for reference.
message += "Task being created..."; var child = store.NewWorkItem("Task"); child.Title = task; child.Tags = self.Tags; child.IterationPath = self.IterationPath; child.AreaPath = self.AreaPath; self.Relations.AddChild(child);
I have tried this a few times and haven't had any issues. Are you using Resource version 1.0 on the service hooks in DevOps?
Yes. It is version 1.0. This is by default setup by the aggregator-CLI and I never change this (I consider it taboo :-) ) Also, in Azure, the Runtime version for the function app is set to ~3, also by the CLI install instance process. Is there anything else I can check?
Running the code you've mentioned is definitely creating the new child and setting up the child's properties ... but it is not added to the Relations. Bummer. So, some of the code works, inside the same rule.
I'm at a loss as to what would be going on. The code I mentioned definitely creates the new Task as well as builds the parent/child relations in my DevOps and Aggregator instances.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Steps to reproduce
When I create a new Bug (or another specific work item type), I want to add a new child to it.
Expected behavior
Expected to add the newly created work item as chilld when using: parent.Relations.AddChild(newChild)
Actual behavior
Not adding to the children
Diagnostic logs
See the attached Rule file
Environment