tfsaggregator / aggregator-cli

A new version of Aggregator aiming at Azure DevOps (ex Visual Studio Team Services)
https://tfsaggregator.github.io/
Apache License 2.0
73 stars 32 forks source link

Impersonation does not work when a rule updates the same work item #206

Closed aok-foss closed 3 years ago

aok-foss commented 3 years ago

Steps to reproduce

Make a rule that triggers on a work item update and then updates the same work item. Enable impersonation for that rule.

.impersonate=onBehalfOfInitiator
self.Description = self.Title;

Expected behavior

The rule triggers impersonated.

Actual behavior

No impersonation.

This is because inside TfsAggregator the WorkItemStore tries to emit a JsonPatchOperation that will do the impersonation: https://github.com/tfsaggregator/aggregator-cli/blob/dbdf4b579e3f1d743c637694be6e0bd820934d1a/src/aggregator-ruleng/WorkItemStore.cs#L158

But inside WorkItemWrapper the change is ignored: https://github.com/tfsaggregator/aggregator-cli/blob/dbdf4b579e3f1d743c637694be6e0bd820934d1a/src/aggregator-ruleng/WorkItemWrapper.cs#L368

Environment

Aggregator 1.0.0 running in Azure Functions on Windows