CSharp · Console
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
string ResponseBody =@"{
""id"": 161635,
""rev"": 1,
""fields"": {
""System.Url"": ""http://google.com"",
""System.Type"": ""Bug"",
""System.State"": ""New"",
""System.AssignedTo"": {
""displayName"": ""John Doe""
}
}
}";
dynamic WorkItemDetailResponse = JObject.Parse(ResponseBody);
Console.WriteLine(WorkItemDetailResponse["id"].ToString());
Console.WriteLine(WorkItemDetailResponse.fields["System.State"].ToString());
Console.WriteLine(WorkItemDetailResponse.fields["System.AssignedTo"]["displayName"].ToString());
}
}