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

Updating a work item is failing when using impersonation since 1.0.1 update #229

Closed sirtwist closed 3 years ago

sirtwist commented 3 years ago

Steps to reproduce

Update a work item field with impersonation enabled (i.e. .impersonate=onBehalfOfInitiator)

A simple update ( self["Custom.CustomField"] = 10) or any other update will trigger an error.

Version 1.0.1

Expected behavior

WorkItem should be updated successfully

Actual behavior

Update fails with the message: "Remove requires Value to be null."

Diagnostic logs

Running it locally and adding some additional debug info:

[2021-02-06 16:11:35Z] [{"Method":"PATCH","Uri":"/_apis/wit/workItems/160536?bypassRules=True&suppressNotifications=False&api-version=5.0-preview.3","Headers":{"Content-Type":"application/json-patch+json"},"Body":"[{\"op\":5,\"path\":\"/rev\",\"from\":null,\"value\":11},{\"op\":2,\"path\":\"/fields/Custom.GTRMScore\",\"from\":null,\"value\":80},{\"op\":1,\"path\":\"/fields/System.ChangedBy\",\"from\":null,\"value\":\"George Roberts\"}]"}] [2021-02-06 16:11:35Z] [{"Code":400,"Headers":{"Content-Type":"application/json; charset=utf-8"},"Body":"{\"count\":1,\"value\":{\"Message\":\"Remove requires Value to be null.\"}}"}] [2021-02-06 16:11:35Z] Save failed: {"count":1,"value":{"Message":"Remove requires Value to be null."}} [2021-02-06 16:11:35Z] Changes saved to Azure DevOps (mode Batch): 0 created, 1 updated. [2021-02-06 16:11:35Z] Rule returned '' [2021-02-06 16:11:35Z] Succeeded

First log line is the JsonPatchDocument info for the update.

Second log line is the actual response with the response code.

Environment

Happens both locally and in Azure Functions.

Version 1.0.1