Hi All,
I'm using Jira API to pull date from Jira and populate on Excel
Problem - I'm not to deserialize the response
I used this to create the response object
https://json2csharp.com/
Verified Json using this http://json.parser.online.fr/
can comeone please help me with a reference link or sample code
private static async Task SearchJira()
{
try
{
string apiUrl = @"https://URL/rest/api/3/search?jql=project=ProjectName&maxResults=10";
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), apiUrl))
{
var base64authorization =
Convert.ToBase64String(Encoding.ASCII.GetBytes("emailId:CU2NhBYhT2Di48DA9"));
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
var response = await httpClient.SendAsync(request);
// I can Json response in this variable
var jsonString = await response.Content.ReadAsStringAsync();
// How to populate the response object
var jsonContent = JsonConvert.DeserializeObject<JiraResponse>(jsonString);
}
}
}
catch (Exception ex)
{
throw ex;
}
}
Now I need to populate the list so that I can intern populate my excel and move forward with code...
Appreciate the help
