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.
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.