public int GetUnsized(string team) { using (var client = new HttpClient()) { var byteArray = new System.Text.UTF8Encoding().GetBytes("AutomationService:Aut0mate0n!"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; HttpResponseMessage response = client.GetAsync(getUnsizedURL(team)).Result; if (response.IsSuccessStatusCode) { string r = response.Content.ReadAsStringAsync().Result; ResponseUnsized result1 = JsonConvert.DeserializeObject <ResponseUnsized>(r); return(result1.total); } else { Debug.WriteLine("failed Query"); return(-1); } } }
public int GetAllUnsized(string team) { using (var client = new HttpClient()) { var byteArray = new System.Text.UTF8Encoding().GetBytes("AutomationService:Aut0mate0n!"); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; HttpResponseMessage response = client.GetAsync("https://jira.whipplehill.com/rest/api/2/search?filter=14610&jql=project%20in%20(onBoard%2C%20onCampus%2C%20onRecord%2C%20onMessage)%20AND%20(sprint%20not%20in%20openSprints()%20AND%20sprint%20not%20in%20closedSprints()%20OR%20sprint%20is%20EMPTY)%20AND%20%22Story%20Points%22%20is%20EMPTY%20AND%20status%20not%20in%20(Released%2C%20Closed)%20ORDER%20BY%20summary%20ASC%2C%20cf%5B10300%5D%20ASC").Result; if (response.IsSuccessStatusCode) { string r = response.Content.ReadAsStringAsync().Result; ResponseUnsized result1 = JsonConvert.DeserializeObject <ResponseUnsized>(r); return(result1.total); } else { Debug.WriteLine("failed Query"); return(-1); } } }