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

fixed an issue which caused removing work item links to fail #235

Closed rjosborne closed 3 years ago

rjosborne commented 3 years ago

This fixes issue #234

From what I can see, there are two issues:

1) RemapIdReferences calls IsWorkItemRelation, which is expecting a RelationPatch as a value. However - remove link operations previously sent an integer value (i.e. the index of the item being removed). This led to the object reference not set error.

Fixing this issue to tolerate a non RelationPatch value resulted in a new error message which continued to prevent links from being removed.

2) the Remove link operation was previously built up with a Path value of "/relations/-" and a Value of the index to remove. According to the MS documentation this is not correct and the json should be structured as per the below.

[ { "op": "test", "path": "/rev", "value": 3 }, { "op": "remove", "path": "/relations/2" } ]

Making both of the above changes results in the remove operation working as expected.

giuliov commented 3 years ago

Thanks for the contribution: now is merged in release/1.1 branch.