Closed ideoclickVanessa closed 4 years ago
Apparently this code was the problem for some reason:
JsonPatchDocument json = VssJsonPatchDocumentFactory.ConstructJsonPatchDocument(Operation.Add, new Dictionary<string, object>
{
{ "/fields/System.AreaPath", "IdeoClick" },
{ "/fields/System.IterationPath", "IdeoClick" },
{ "/fields/System.Title" , "This is a test bug 2." },
});
Once I more manually created the JsonPatchDocument like this:
JsonPatchDocument json = new JsonPatchDocument();
json.Add(new JsonPatchOperation
{
Operation = Operation.Add,
Path = "/fields/System.AreaPath",
Value = "IdeoClick",
});
json.Add(new JsonPatchOperation
{
Operation = Operation.Add,
Path = "/fields/System.IterationPath",
Value = "IdeoClick",
});
json.Add(new JsonPatchOperation
{
Operation = Operation.Add,
Path = "/fields/System.Title",
Value = "This is a test bug.",
});
The exception went away and the call was successful.
I am running into the same exception as #153 and this StackOverflow item. Both the closed issue and the StackOverflow item are over a year old and don't provide a working example; therefore, I'm opening this issue.
First, I manually created a new Product Backlog Item via the UI. As you can see from this screenshot, its Area and Iteration Path is
IdeoClick
:I then attempted to create a new Product Backlog Item via this nuget package:
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.153.0" />
and this code:However, it keeps throwing this exception:
Could you please provide insight into what I'm doing wrong and/or provide a working Create Work Item sample?